// the find
jazzband/geojson
Python bindings and utilities for GeoJSON
A Python library that wraps GeoJSON RFC 7946 types into proper Python objects with serialization, validation, and a handful of coordinate utilities. It's for anyone who needs to produce or consume GeoJSON without hand-rolling dicts, particularly in geospatial data pipelines or web APIs that speak GeoJSON.
The `__geo_interface__` support means it plays nicely with shapely, fiona, and most of the Python geo stack without adapters. Coordinate precision rounding at 6 decimal places by default is a sensible choice that silently fixes the 'why is my JSON 400 bytes per point' problem. The utility functions — `map_tuples`, `map_coords`, `map_geometries` — cover the coordinate manipulation cases that come up constantly (reprojection order flips, scaling). Under Jazzband stewardship with CI and recent activity; not an abandoned side project.
Validation is shallow — `is_valid` catches obviously malformed coordinates but won't catch things like unclosed polygon rings with floating-point near-equality, winding order violations (RFC 7946 requires right-hand rule), or antimeridian crossing issues. No support for reading from files or URLs directly; you write the I/O, it handles the types. The `generate_random` utility produces geometries that aren't guaranteed to be topologically valid, which will silently break code that passes them to anything doing spatial operations. Nearly 1000 stars but only ~130 forks suggests it's widely used as a dependency rather than extended, meaning edge cases in geometry handling accumulate quietly.