A Python library for converting ArcGIS JSON to GeoJSON
Project description
arcgis2geojson.py
A Python library for converting ArcGIS JSON to GeoJSON: A partial port of ESRI's arcgis-to-geojson-utils.
Installation
pip install arcgis2geojson
Usage
As a Library
Convert an ArcGIS JSON string to a GeoJSON string
>>> from arcgis2geojson import 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}}}"""
>>> output = arcgis2geojson(input)
>>> output
'{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[41.8359375, 71.015625], [21.796875, 36.5625], [56.953125, 33.75], [41.8359375, 71.015625]]]}, "properties": {"OBJECTID": 123}, "id": 123}'
>>> type(output)
<class 'str'>
Convert a python dict to a python dict
>>> from arcgis2geojson import 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}}}
>>> output = arcgis2geojson(input)
>>> output
{'type': 'Feature', 'geometry': {'type': 'Polygon', 'coordinates': [[[41.8359375, 71.015625], [21.796875, 36.5625], [56.953125, 33.75], [41.8359375, 71.015625]]]}, 'properties': {'OBJECTID': 123}, 'id': 123}
>>> type(output)
<class 'dict'>
On the Console
# 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
Versioning
arcgis2geojson follows semantic versioning. For this project, the "API" also includes:
- CLI flags and options
- CLI exit codes
From version 3 onwards, arcgis2geojson will drop compatibility with unsupported python versions without incrementing the major version. This is in line with common practice in the python community.
Licensing
arcgis2geojson is a derivative work of ESRI's arcgis-to-geojson-utils. Original code is Copyright 2015 by Esri and was licensed under the Apache License, Version 2.0.
arcgis2geojson is made available under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arcgis2geojson-3.1.1.tar.gz.
File metadata
- Download URL: arcgis2geojson-3.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cab61e119a59bbee0df091531e6a242ca0835c348ab68e2f4671b39464c3bb4d
|
|
| MD5 |
c2dd6f9af7f38d9a548f0b143058b10d
|
|
| BLAKE2b-256 |
78048f50099f2a1af522119bc0b552719904a2cee5a2abb70a9c0eec72071a5a
|
Provenance
The following attestation bundles were made for arcgis2geojson-3.1.1.tar.gz:
Publisher:
publish.yml on chris48s/arcgis2geojson
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arcgis2geojson-3.1.1.tar.gz -
Subject digest:
cab61e119a59bbee0df091531e6a242ca0835c348ab68e2f4671b39464c3bb4d - Sigstore transparency entry: 630380803
- Sigstore integration time:
-
Permalink:
chris48s/arcgis2geojson@0b3268d07896db8418c8737989bcd19f9e26a573 -
Branch / Tag:
refs/tags/3.1.1 - Owner: https://github.com/chris48s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0b3268d07896db8418c8737989bcd19f9e26a573 -
Trigger Event:
create
-
Statement type:
File details
Details for the file arcgis2geojson-3.1.1-py3-none-any.whl.
File metadata
- Download URL: arcgis2geojson-3.1.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c52b2ea460072d6961e0c37cc0407d3ae9f7c65bca6cae92435378edfa324b1
|
|
| MD5 |
872c1c793021c9f16b156858aa1e1f40
|
|
| BLAKE2b-256 |
d50216cbc3a6ada4937f64336b4b0e68e32be8817ccefc91ed13c3e4575ef552
|
Provenance
The following attestation bundles were made for arcgis2geojson-3.1.1-py3-none-any.whl:
Publisher:
publish.yml on chris48s/arcgis2geojson
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arcgis2geojson-3.1.1-py3-none-any.whl -
Subject digest:
5c52b2ea460072d6961e0c37cc0407d3ae9f7c65bca6cae92435378edfa324b1 - Sigstore transparency entry: 630380808
- Sigstore integration time:
-
Permalink:
chris48s/arcgis2geojson@0b3268d07896db8418c8737989bcd19f9e26a573 -
Branch / Tag:
refs/tags/3.1.1 - Owner: https://github.com/chris48s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0b3268d07896db8418c8737989bcd19f9e26a573 -
Trigger Event:
create
-
Statement type: