How to add a custom north arrow to ArcMap?
How to do column editing in vim?
https://stackoverflow.com/a/6972206/4539590
To edit a column, follow these steps:
parsing-non-zero-padded-timestamps-in-python
datetime.strptime(): creates a datetime object from the given string.
from datetime import datetime
dt_string = "12/11/2018 09:15:32"
dt_object1 = datetime.strptime(dt_string, "%d/%m/%Y %H:%M:%S")
dt_object2 = datetime.strptime(dt_string, "%m/%d/%Y %H:%M:%S")
https://gdal.org/drivers/vector/shapefile.html
Normally the OGR Shapefile driver treats a whole directory of shapefiles as a dataset, and a single shapefile within that directory as a layer.
In this case the directory name should be used as the dataset name.
However, it is also possible to use one of the files (.shp, .shx or .dbf) in a shapefile set as the dataset name, and then it will be treated as a dataset with one layer.
ogrinfo -sql "ALTER TABLE ymss_elements_0 ADD COLUMN id integer " shapefile_dir
OGR command line tools accept only 1 input. But we have 2 inputs for the spatial join. An easy way to fix this, is to use a VRT file. A VRT file allows us to specify multiple inputs and pass them to the command-line tool as layers of a single input.
Unzip the input shapefiles in a single folder on your drive. Create a file named input.vrt in the same folder with the following content.
<OGRVRTDataSource>
<OGRVRTLayer name="boroughs">
<SrcDataSource>nybb.shp</SrcDataSource>
<SrcLayer>nybb</SrcLayer>
</OGRVRTLayer>
<OGRVRTLayer name="nursinghomes">
<SrcDataSource>OEM_NursingHomes_001.shp</SrcDataSource>
<SrcLayer>OEM_NursingHomes_001</SrcLayer>
</OGRVRTLayer>
</OGRVRTDataSource>
Open the OSGeo4W shell and cd to the directory containing the shapefiles and the vrt file. Run the ogrinfo command to check if the VRT file is correct.
ogrinfo input.vrt
OGR tools can run SQL queries on the input layers. We will use the ST_INTERSECTS function to find all nursing homes that intersect the boundary of a borough and use the SUM function to find the total nursing home capacity of a borough. Run the following command.
ogrinfo -sql "SELECT b.BoroName, sum(n.Capacity) as total_capacity from
boroughs b, nursinghomes n WHERE ST_INTERSECTS(b.geometry, n.geometry) group
by b.BoroName" -dialect SQLITE input.vrt
You can see that in a single command we got the results by doing a spatial join that takes a lot of clicking around in a GIS environment. We can do a reverse spatial join as well. We can join the name of the Borough to each feature of the Nursing Homes layer. Using the ogr2ogr tool we can write out a shapefile from the resulting join. Note that we are adding a geometry column in the SELECT statement which results in a spatial output. Run the following command:
ogr2ogr -sql "SELECT n.Name, n.Capacity, n.geometry, b.BoroName from
boroughs b, nursinghomes n WHERE ST_INTERSECTS(b.geometry, n.geometry)"
-dialect SQLITE output.shp input.vrt
Open the output.shp in a GIS to verify that the new shapefile as attributes joined from the intersecting borough. You can use ogrinfo command to check that as well.
ogrinfo -al output.shp
One has to be mindful that in Python (and NumPy), the nan's
don’t compare equal, but None's
do.
Note that pandas/NumPy uses the fact that np.nan != np.nan
, and treats None
like np.nan
.
In [11]: None == None Out[11]: True In [12]: np.nan == np.nan Out[12]: False
InitSpatialMetadata() very slowly
initialize spatial metadata tables
SpatiaLite 5.0.0 SQL functions reference list
以下方法是有效的,基本上瞬间完成:
BEGIN ;
SELECT InitSpatialMetadata() ;
COMMIT ;
--------------------------------------
默认情况下,SQLite 中每条 SQL 语句自成事务(自动给提交模式)。也就是说,如果你没有使用
begin...commit/rollback 定义事务的范围,SQLite 默认每条单独的 SQL 命令就是有
begin...commit/rollback
的事务。这种情况下,所有成功完成的命令都自动提交。同样,所有遇见错误的命令都回滚。这种操作模式(隐式事务)也称为自动提交模式:SQLite
以自动提交模式运行单个命令,如果命令没有失败,那它将自动提交。
.mode csv
.import --csv --skip 1 信息.csv 信息
注意:sqlite3.32.0 (2020-05-22)中,才加入 --csv --skip 1 功能。
SpatiaLite 3.0 SQL functions reference list
list the tables in a SQLite database file
SpatiaLite database tables management with QGis 2.8
https://github.com/qgis/QGIS/issues/37790
SELECT * FROM sqlite_master WHERE type='table';
SELECT id, st_astext(st_centroid(st_geometryn(P.geom,1))) FROM '桥墩位置2020-09-29' as P WHERE id < 10;
--下面的语句没有执行成功
UPDATE '桥墩位置2020-09-29' SET centroid_geom = st_centroid(st_geometryn(geom,1));
check if port is in use on Linux
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo lsof -i:22 ## see a specific port such as 22 ##
sudo nmap -sTU -O IP-address-Here
域名.key是秘钥;
a.cer存储的是CA证书,
域名.cer是域名证书,
fullchain.cer是前两者的拼接;
域名.csr是证书签名请求。
----------------------------------------------------
Let’s Encrypt颁发的HTTPS证书一般包括以下几个文件:
cert.key(PEM格式):私钥文件
cert.cer(PEM格式):证书文件
fullchain.cer(PEM格式):包含证书和中间证书
-----------------------------------------------------
PEM
适用于Apache、Nginx、Candy Server等Web服务器
常见的文件后缀为.pem、.crt、.cer、.key
可以存放证书或私钥,或者两者都包含
.key后缀一般只用于证书私钥文件
PFX
适用于IIS等Web服务器
常见的文件后缀为.pfx、.p12
同时包含证书和私钥,且一般有密码保护
JKS
适用于Tomcat、Weblogic、JBoss、Jetty等Web服务器
常见的文件后缀为.jks
channels:
- defaults
# Show channel URLs when displaying what is going to be downloaded and
# in 'conda list'. The default is False.
show_channel_urls: True
allow_other_channels: True
proxy_servers:
http: socks5://127.0.0.1:1080
https: socks5://127.0.0.1:1080
ssl_verify: False
有助于理解pandas中DataFrame的conlumns、index属性的直接赋值。
for i in $(seq -f "%05g" 10 15)
do
echo $i
done
for i in $(seq -f "%04g" 2 36)
do
url="http://www.ttt.com/img/$i.jpg"
echo $url
wget $url
done
for i in $(seq 30); do echo "http://www.example.com/page$i.html" ; done | wget -i -
ledehome自带的阿里dns,存在bug,只更新子域名,不更新主域名。
单位的网络,把ssh的22端口,封了。
入坑软路由和虚拟化 - 家庭虚拟化及软路由安装配置日志
对vSphere虚拟交换机的理解
虚拟机网络模型详解
ESXi虚拟网络配置的认识
ESXi 配置公网访问
VMware ESXI 6.7 web端配置虚拟机双网卡
esxi6.7在终端开启命令行模式,取消网卡直通
零基础玩转ESXi虚拟机架设软路由、黑裙
管理ESXi 6.7 主机网络与虚拟机网络
Esxi 内两个虚拟设备之间怎么通过虚拟网络链接呢?
ESXI 下面的虚拟机配置公网 IP
用虚拟交换机创建并管理ESXI网络
VMware vSphere 网络设置最佳实践
基于ESXi的LEDE软路由安装与配置
无法打开磁盘 scsi0:0: 磁盘类型 7 不受支持或无效
x64 OpenWrt(LEDE)v2020.7.18更新v5.4.50内核 UPnP+NAS+多拨+DNS优化
LEDE的vmdk在esxi下提示scsi0:0的磁盘类型不受支持或无效
基于ESXi的LEDE软路由安装与配置
基于ESXi的软路由(LEDE)与黑群晖的安装与配置
esxi安装ax88179, USB3.0网卡驱动
https://flings.vmware.com/usb-network-native-driver-for-esxi