$ show jazzband/geojson
This is a Python library for working with GeoJSON data, providing classes for all GeoJSON geometry types (Point, LineString, Polygon, etc.), Feature and FeatureCollection objects, and utility functions for encoding/decoding to/from JSON. It implements the __geo_interface__ protocol for integration with other geospatial tools and includes validation for GeoJSON spec compliance. The code is pure Python with no external dependencies, well-tested, and actively maintained by the Jazzband community.
The LLM identified 3 files worth highlighting for reuse:
Base Geometry class with recursive coordinate rounding to configurable precision and per-type validation functions (check_point, check_line_string, check_polygon). This component implements the core GeoJSON geometry logic and can be reused independently for coordinate sanitization and validation in geospatial applications.
Utility functions for extracting (coords), mapping (map_coords, map_tuples), and transforming (map_geometries) coordinates from nested GeoJSON structures. Also provides generate_random for test data. These functional patterns are self-contained and can be applied to any nested coordinate tree, making them reusable for geospatial data processing.
Custom JSON encoder (GeoJSONEncoder) and decoder hooks that enforce strict JSON compliance (reject NaN/Infinity) and automatically convert between plain dicts and GeoJSON objects via object_hook. This serialization layer is essential for GeoJSON interoperability and demonstrates safe JSON handling patterns.