Skip to main content

Minimal GeoJSON parser and emitter

Project description

” picogeojson ===========

Build Status Coverage Status

Straightforward and compliant GeoJSON parsing and serialization with zero dependencies. Easily ingest or output GeoJSON adhering to the IETF proposed standard.

Documentation

GeoJSON strings or files are read using the fromstring() and fromfile() functions.

result = picogeojson(fromstring('{"type": "Point", "coordinates": [1.0, 3.0]}'))
# -> Point(coordinates=[1.0, 3.0])

GeoJSON objects are constructed in Python and serialized with tostring().

picogeojson.tostring(
    picogeojson.Point([1.0, 3.0])
)
# -> {"coordinates": [1.0, 3.0], "type": "Point"}'

Keyword arguments can be passed to tostring() that - enforce Polygon/MultiPolygon rotation direction, with counterclockwise for external rings and clockwise for internal rings - split objects that cross the international dateline into multipart objects, for easier processing - alter

Deserializer and Serializer objects are provided for customization.

This is a standalone Python package extracted from the Karta geojson submodule.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

picogeojson-0.4.0.tar.gz (8.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page