2019年12月18日星期三

PointZ and PointM Data Types

PointZ and PointM Data Types

PointZ and PointM have the same properties as the Point data type except they contain one more ordinate. 

The Z is the elevation and the M is the measurement. 

Syntactically these types are similar.

2019年12月14日星期六

gdal中配置选项的使用

1、转换dxf文件时经常用到的选项
     set GDAL_FILENAME_IS_UTF8=NO
     set OGR_ARC_MAX_GAP=20
     set DXF_ENCODING=CP936
ogr2ogr --config OGR_ARC_MAX_GAP 20 -s_srs EPSG:2384 -t_srs EPSG:2384 -f "ESRI Shapefile" center_line2.shp  道路中心线.dxf

ogr2ogr --config OGR_ARC_STEPSIZE 1 -s_srs EPSG:2384 -t_srs EPSG:2384 -f "ESRI Shapefile" center_line3.shp  道路中心线.dxf

ogr2ogr -segmentize 20 -s_srs EPSG:2384 -t_srs EPSG:2384 -f "ESRI Shapefile" center_line5.shp  道路中心线.dxf

ogr2ogr --config GDAL_FILENAME_IS_UTF8 NO -simplify 10  -s_srs EPSG:2384 -t_srs EPSG:2384 -f "ESRI Shapefile" center_line8.shp  道路中心线.dxf

2、官方文档
      https://gdal.org/drivers/vector/dxf.html#vector-dxf

      https://trac.osgeo.org/gdal/wiki/ConfigOptions

      https://gdal.org/user/configoptions

      set-default-gdal-ogr-config-options

      using-dxf-arc-or-circle-accurately-in-arcgis-for-desktop

 3、多段线简化

      cmdoption-ogr2ogr-simplify

      cmdoption-ogr2ogr-segmentize

     道格拉斯-普克算法

    Ramer–Douglas–Peucker algorithm

iterative-version-of-ramer-douglas-peucker-line-simplification-algorithm/

2019年12月8日星期日

osx brew gdal

osx中,postgis自带的ogr2ogr执行的sql包含ST_Centroid时,出错,原因不明,
使用brew install 的gdal,没有问题。

How to Find Where Homebrew Packages Are Installed on Mac

gdal Formula

ogr2ogr centroid.shp fields.shp -dialect sqlite -sql "SELECT ST_Centroid(geometry), id, name from fields"

Debian中安装postgresql

install-postgresql-database-in-debian-10