A Python library for converting OpenStreetMap and Overpass API XML/JSON data into GeoJSON format.
osm2geojson is a Python library that converts OpenStreetMap (OSM) and Overpass API data from XML or JSON formats into GeoJSON. It solves the problem of integrating raw OSM data into modern mapping applications and GIS tools that require the GeoJSON standard, providing a clean and programmable interface for this transformation.
Geospatial developers, data scientists, and GIS professionals who work with OpenStreetMap data and need to convert it into GeoJSON for visualization, analysis, or integration with other mapping libraries.
Developers choose osm2geojson because it offers a dedicated, well-tested Python solution for OSM-to-GeoJSON conversion with support for both XML and JSON inputs, direct Overpass API querying, and the flexibility of intermediate Shapely geometry objects.
Convert OSM and Overpass XML/JSON to GeoJSON
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles both OSM/Overpass XML and JSON inputs, offering flexibility for various data sources as highlighted in the README's key features.
Provides intermediate Shape objects with Shapely geometries, enabling advanced geometric operations and custom processing before GeoJSON conversion, demonstrated in the examples.
Includes a helper function to execute Overpass API queries with automatic retries, simplifying the workflow from data fetching to conversion, as shown in the usage section.
Offers parameters like filter_used_refs and polygon_features for fine-tuned control, allowing developers to tailor output based on specific needs, detailed in the API reference.
Explicitly marked as 'under development' in the README, with a ToDo list indicating missing features like support for complex multipolygons and comprehensive CLI tests, which could affect stability.
As a Python library, it may struggle with very large OSM datasets due to in-memory processing, and the README lacks performance benchmarks or streaming options for efficiency.
Relies on external data files for polygon features and area keys that require manual updates via scripts, potentially introducing maintenance overhead and compatibility risks.