用于将arcgis json转换为geojson的python库
arcgis2geojson的Python项目详细描述
arcgis2geojson.py
用于将arcgis json转换为geojson的python库:esri的arcgis-to-geojson-utils的部分端口。
安装
pip install arcgis2geojson
用法
作为图书馆
>>>input={...'attributes':{'OBJECTID':123},...'geometry':{'rings':[[[41.8359375,71.015625],...[56.953125,33.75],...[21.796875,36.5625],...[41.8359375,71.015625]]],...'spatialReference':{'wkid':4326}}}>>>fromarcgis2geojsonimportarcgis2geojson>>>output=arcgis2geojson(input)>>>importpprint>>>pp=pprint.PrettyPrinter(indent=4)>>>pp.pprint(output){'geometry':{'coordinates':[[[41.8359375,71.015625],[56.953125,33.75],[21.796875,36.5625],[41.8359375,71.015625]]],'type':'Polygon'},'id':123,'properties':{'OBJECTID':123},'type':'Feature'}
在控制台上
# convert ArcGIS json file to GeoJOSN file $ arcgis2geojson arcgis.json > geo.json # fetch ArcGIS json from the web and convert to GeoJSON $ curl "https://myserver.com/arcgis.json"| arcgis2geojson
许可
arcgis2geojson是esri的arcgis-to-geojson-utils的派生作品。原始代码由ESRI于2015年版权所有,并根据the Apache License, Version 2.0获得许可。
arcgis2geojson在mit许可下可用。