Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

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.

Files for picogeojson, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size picogeojson-0.4.0.tar.gz (8.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page