Skip to main content

esrijson

Build Status

Introduction

This module is meant to build a bridge between GDAL __geo_interface__ property via Shapely. There is no concept of GeometryCollection in esrijson syntax, so there is only a limited support for this concept. Currently, we only take the first geometry and drop the rest. This library is heavily inspired by python-geojson.

Usage

import esrijson
from shapely import geometry

# Create an esrijson feature
feat = esrijson.Feature(geometry=geometry.Point(1, 4), attributes={'name': 'dummy', 'val': 1}, wkid=2056)
# Dump to json
dumped = esrijson.dumps(feat)
# Load to Feature back again
loaded = esrijson.loads(dumped)
print(loaded)
print(type(loaded))

>>> {'geometry': {'y': 4.0, 'x': 1.0}, 'spatialReference': {u'wkid': 2056}},'attributes': {u'name': u'dummy', u'val': 1}}
>>> <class 'esrijson.feature.Feature'>

# You can also transform an esri json like object into a shapely object
geom = esrijson.to_shape({"paths": [[[0.0, 0.0], [1.0, 1.0]], [[-1.0, 0.0], [1.0, 0.0]]]})
print(getattr(geom, '__geo_interface__')

>>> {'type': 'MultiLineString', 'coordinates': (((0.0, 0.0), (1.0, 1.0)), ((-1.0, 0.0), (1.0, 0.0)))}

# And of your do the same operation back again
esri_geom = esrijson.from_shape(geom)
print(esri_geom)
>>> {'paths': (((0.0, 0.0), (1.0, 1.0)), ((-1.0, 0.0), (1.0, 0.0)))}

ESRI specs references

Metadata

Release files for esrijson 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for esrijson 0.4.4
File Size Uploaded Provenance Actions
esrijson-0.4.4.tar.gz 5.3 kB Without provenance Details for esrijson-0.4.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for esrijson 0.4.4
File Interpreter ABI Platform Actions
esrijson-0.4.4-py3-none-any.whl Python 3 none any Details for esrijson-0.4.4-py3-none-any.whl

Total release size: 13.3 kB

Release files / esrijson-0.4.4.tar.gz

Download URL esrijson-0.4.4.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
19b0443e8849184c7359dadfa8be8cb9d5b7d7ec6e6d73ec8ad4503acc2cb542
BLAKE2b-256 checksum
How to use checksums
1468eb660137deb8de6fe6dd85a673538992571368a7602fbeb0ecec52eb4391
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.2

Release files / esrijson-0.4.4-py3-none-any.whl

Download URL esrijson-0.4.4-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26ef946527f64b50d44386e843ad41b4cc3d5a5cff684a1cb91731a17295371b
BLAKE2b-256 checksum
How to use checksums
8aa2b6a496c0a0556ef1ac520ab4ac58c3bd8db0aafefef9e66da0e36bf44f84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.2

Security for esrijson 0.4.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page