Minimal GeoJSON parser and emitter
Project description
” picogeojson ===========
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
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.