SQLServer转geojson
ogr2ogr -f GeoJson station2.geojson "MSSQL:server=192.168.1.9,1433;database=database;UId=sa;PWD=12345" -sql "select * from UserStation"
shp转个geojson
ogr2ogr -f GeoJson test.geojson test.shp
ogr2ogr -F "ESRI Shapefile" point.shp point.geojson OGRGeoJSON
带编码转换
ogr2ogr -F "ESRI Shapefile" hx4.shp point.geojson -lco ENCODING=UTF-8
Pg 转Geojson
ogr2ogr-f GPX c:\temp\points.gpx PG:"host=localhost port=5432
dbname=SpatialPlayground schemas=public user=postgres password=password"
-sql "SELECT * FROM PointsForGpxExport"
geojosn 转SHP
ogr2ogr -nlt POINT -skipfailures points.shp geojsonfile.json OGRGeoJSON
ogr2ogr -nlt LINESTRING -skipfailures linestrings.shp geojsonfile.json OGRGeoJSON
ogr2ogr -nlt POLYGON -skipfailures polygons.shp geojsonfile.json OGRGeoJSON