chris48s / arcgis2geojson Goto Github PK
View Code? Open in Web Editor NEW๐ A Python library for converting ArcGIS JSON to GeoJSON
Home Page: https://pypi.org/pypi/arcgis2geojson/
License: Other
๐ A Python library for converting ArcGIS JSON to GeoJSON
Home Page: https://pypi.org/pypi/arcgis2geojson/
License: Other
Dependabot can't resolve your Python dependency files.
As a result, Dependabot couldn't update your dependencies.
The error Dependabot encountered was:
Creating virtualenv arcgis2geojson-rpJyR8m4-py3.8 in /home/dependabot/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...
[PackageNotFound]
Package coveralls (1.11.1) not found.
If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.
Now if object has non-standard crs, converter only log about it:
WARNING:root:Object converted in non-standard crs - {'wkid': 102100, 'latestWkid': 3857}
In fact it generates invalid geojson (you cannot load if you don't know that's coded in projection coordinates)
Anyway, it's looking only for wkid
and not checking the latest_wkid
value. The second one is more important.
I'm working on ArcGIS REST API version 10.61
Converting from ArcGIS coordinates to GPS (WGS84 deg) coordinates.
You can use https://github.com/pyproj4/pyproj library. Take a look at this example https://pyproj4.github.io/pyproj/stable/examples.html#converting-between-geographic-and-projection-coordinates-within-one-datum. ArcGIS wkid is the EPSG value, so it should be easy.
If you need my help with this one just tell me :)
@chris48s: Fantastic port!!! Thanks for this project!!
I'm retrieving feature data from a government ArcGIS-based REST service and then inserting into a postgis table. I'm converting Arcgis geometry to geojson using arcgis2geojson and then using geoalchemy2 to convert to native postgis geometry (I'm sure there's a better way...)
Anyway, some of the features from this source has geometry (rings) that is very complex i.e. has many points (in Notepad++ text editor, there is one feature where /feature/geometry/rings has almost 11million+ text columns!!). I know I need to simplify the geometry before insert into postgis but I think I need to convert it to something like geojson first.
Any experience you could share on the below:
a) How I can simplify the esri arcgis geometry before running arcgis2geojson?
or
b) Ways to get arcgis2geojson to complete the operation on very complex arcgis geometry json faster? Do you know of data issues that could be fixed/removed in the source to improve performance?
or
c) Adding some print output to show progress of arcgis2geojson?
ArcGIS online data appears to default to WKID 102100 CRS. GeoJSON coordinates are supposed to be in lat/long, and anything else seems to violate the standard. I haven't yet found a simple way to convert before feeding to arcgis2geojson, or having arcgis2geojson do it.
The coordinate reference system for all GeoJSON coordinates is a
geographic coordinate reference system, using the World Geodetic
System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
of decimal degrees.
WARNING:root:Object converted in non-standard crs - {'wkid': 102100}
{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-11788432, 4821816], [-11788404, 4821784], [-11788432, 4821816]]]}, "properties": null}
greetings! ๐
if you're interested in advertising this port, i'd be happy to merge a PR for that.
The attached file comes out of an .mpk
I thought I should be able to convert it using the arcgis2geojson CLI.
It does not work - is this a problem with arcgis2geojson, or did I just think wrong? Maybe this file isn't actually a (valid? complete?) esrijson... in which case I figure it is worth posting this just to document it for anyone else who tries the same thing.
webmap.json.txt
Is the RFC 7946 GeoJSON standard supported?
see https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm
Please note the "curveRings" and "a" (arc) and "c" (curve) sub elements.
{"attributes": {"OBJECTID": 1, "SHAPE_Length": 805537.4115684855, "SHAPE_Area": 2112154014.3018234}, "geometry": {"curveRings": [[[149.12727210247652, -35.4212143679875], [149.12752876991442, -35.42141914018136],...,
[[149.1058535132325, -35.36227454544572], [149.1068481686017, -35.36403515635332], {"a": [[149.1078283222431, -35.36423260491624], [149.10725558992584, -35.36454419046313], 1, 1, 1.634440547892481, 0.0006520029603579291, 0.9999999999673727]}, [149.1078531917493, -35.36427530079017], [149.1081456005895, -35.36476045354947], {"a": [[149.10865404238527, -35.3649093717257], [149.1082331954929, -35.36540381310371], 1, 1, 1.6505728935396604, 0.0006492952973245373, 0.999999999978183]}, [149.1090321075761, -35.36520613522933], {"c": [[149.11080906542628, -35.36528749555381], [149.1106174356746, -35.36522861722279]]}, [149.11123748446576, -35.365485861922345], {"a": [[149.11156822568088, -35.36589306774236], [149.11100128894847, -35.366015625367325], 1, 1, 1.6872148079115887, 0.000580032438778483, 0.9999999999384529]}, [149.1116166331043, -35.366228085409794], {"a": [[149.11112920227166, -35.36681457489669], [149.1110355305778, -35.366240928059554], 1, 1, 1.4964161085847754, 0.0005812444236218323, 0.9999999999334054]}, [149.10998161567082, -35.36706219628817], [149.10985623887484, -35.36724787834585], [149.1103982955488, -35.367785679597255], .....
see response of https://data.actmapi.act.gov.au/arcgis/rest/services/ACT_EMERGENCY_MANAGEMENT/esa_sbmp_BPA_current/MapServer/0/query?objectIds=1&outFields=*&returnGeometry=true&outSR=4326&returnTrueCurves=true&returnIdsOnly=false&returnCountOnly=false&f=pjson
for full example.
Point Feature Class exported using "Features To JSON" tool in ArcGIS Pro 2.1.2:
arcpy.conversion.FeaturesToJSON("FC_Point_Domain_test_full_WGS84", r"C:\Users\T40\Documents\ArcGIS\Projects\FC_Point_WGS84.json", "NOT_FORMATTED", "NO_Z_VALUES", "NO_M_VALUES", "NO_GEOJSON")
ArcGIS JSON output:
{"displayFieldName":"","fieldAliases":{"OBJECTID":"OBJECTID","Status":"Status"},"geometryType":"esriGeometryPoint","spatialReference":{"wkid":4326,"latestWkid":4326},"fields":[{"name":"OBJECTID","type":"esriFieldTypeOID","alias":"OBJECTID"},{"name":"Status","type":"esriFieldTypeString","alias":"Status","length":255}],"features":[{"attributes":{"OBJECTID":1,"Status":"Active"},"geometry":{"x":12.286325095000052,"y":55.940256838000039}}]}
Using arcgis2geojson 1.1.1 to transform ArcGIS JSON to GeoJSON is unsuccessful using:
from arcgis2geojson import arcgis2geojson
output = arcgis2geojson(input)
import pprint
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(output)
{ }
May you please release a CLI wrapper for arcgis2geojson?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.