我正在尝试将一个geojson文件转换成shapefile格式,我尝试使用以下方法(因为我很新手所以可能是错误的)。
import urllib, geojson, gdal
url= ' http://ig3is.grid.unep.ch/istsos/wa/istsos/services/ghg/procedures/operations/geojson?epsg=4326'
response = urllib.urlopen(url)
data = geojson.loads(response.read())
file = open ('data.geojson', 'w')
pickle.dump(data,file)
file.close()
ogr2ogr -f "ESRI Shapefile" destination_data.shp "data.geojson"
我正在从一个URL获取数据,将它放入一个文件中,但当我尝试将它转换成shapefile时出现了以下错误:
File "<stdin>", line 1
ogr2ogr -f "ESRI Shapefile" destination_data.shp "data.geojson"
^
SyntaxError: invalid syntax
由于我很新,所以我尝试了在网上找到的解决方案。有没有办法让这个工作起来?
ogr2ogr
部分。 - asongtoruin