shp与geojson格式互转

ogr2ogr实现geojson格式数据转换成shp格式的数据

ogr2ogr -f "file_format" destination_data source_data

E:\Postgresql\bin>ogr2ogr -f "ESRI Shapefile" f:\\gdal\\countries.shp f:\\gdal\\countries.geojson

效果:

shp与geojson格式互转_第1张图片
image.png

注意点:geojson转shp过程中,geojson文件中不可以含有中文字符

当然同样的:

E:\Postgresql\bin>ogr2ogr -f "geojson" f:\\gdal\\countries_test.geojson f:\\gdal\\countries.shp

实现将shp数据格式转换为geojson格式。

你可能感兴趣的:(shp与geojson格式互转)