osm2geojson
Parse OSM and Overpass JSON
Decision gist · record as of 2026-08-14
Yes, with conditions. Install if you need to convert OSM or Overpass data to GeoJSON or Shapely objects and accept that the library is in active development (Beta status). No known security vulnerabilities, low install friction, and active maintenance make it a reasonable choice. However, verify that the current API and feature set meet your needs, as the documentation notes ongoing development work and incomplete CLI testing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with only two runtime dependencies (shapely, requests).
- Repository is active with recent commits and no archived status.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions.
last release 2026-03-04 (163 days) · last repo commit 2026-07-19 · 113 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 112,204 downloads/mo, #12,377 on PyPI
Alternatives
Verify before relying
import osm2geojson
# From Overpass JSON
geojson = osm2geojson.json2geojson(overpass_json)
# From OSM/Overpass XML
geojson = osm2geojson.xml2geojson(osm_xml)
# To Shape objects (Shapely geometries + properties)
shapes = osm2geojson.json2shapes(overpass_json)- Stability and API maturity: description states 'This library is under development' but classifiers show Beta status; current production-readiness level unclear.
- Performance characteristics with large OSM datasets: no documented limits or benchmarks provided.
- CLI tool completeness: documentation notes 'Add tests and examples for cli tool' as a to-do item.
What it is and what it does
osm2geojson is a parser that transforms geographic data from OpenStreetMap and Overpass API into standard GeoJSON or Shapely geometry objects. It accepts both JSON and XML input formats and provides four main conversion functions: json2geojson, xml2geojson, json2shapes, and xml2shapes. The library depends on shapely for geometric operations and requests for API calls.
You use it when you have OSM or Overpass data and need it in GeoJSON format for web mapping, or as Shapely objects for geometric analysis. It includes an Overpass API query helper (overpass_call) with automatic retries, and supports customization via options like filter_used_refs, log_level, and polygon feature definitions. The package also exposes a command-line interface for batch conversions.
Use it for
- Convert Overpass API query results to GeoJSON for display in web mapping libraries like Leaflet or Mapbox.
- Parse OSM XML export files into Shapely geometry objects for spatial analysis or geometric operations.
- Query the Overpass API directly and convert results to GeoJSON in a single workflow.
- Extract specific OSM feature types (amenities, roads, buildings) and convert to standardized geographic formats.
- Build geographic data pipelines that ingest OSM data and output GeoJSON for downstream processing.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install if you need to convert OSM or Overpass data to GeoJSON or Shapely objects and accept that the library is in active development (Beta status). No known security vulnerabilities, low install friction, and active maintenance make it a reasonable choice. However, verify that the current API and feature set meet your needs, as the documentation notes ongoing development work and incomplete CLI testing.
Install
osm2geojson on PyPI
Before you install
Low friction: pure Python wheel with only two runtime dependencies (shapely, requests). Repository is active with recent commits and no archived status.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions.
Quickstart
import osm2geojson
# From Overpass JSON
geojson = osm2geojson.json2geojson(overpass_json)
# From OSM/Overpass XML
geojson = osm2geojson.xml2geojson(osm_xml)
# To Shape objects (Shapely geometries + properties)
shapes = osm2geojson.json2shapes(overpass_json)
Verify before relying
- Stability and API maturity: description states 'This library is under development' but classifiers show Beta status; current production-readiness level unclear.
- Performance characteristics with large OSM datasets: no documented limits or benchmarks provided.
- CLI tool completeness: documentation notes 'Add tests and examples for cli tool' as a to-do item.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesshapelyrequests |
| Maintenance | Actively maintained 163 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 112,204 / month, #12,377 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: GISTopic :: Software Development :: Libraries :: Python Modules |
Evidence: osm2geojson-0.3.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “osm to geojson converter”
- osm2geojsonConverts OpenStreetMap and Overpass API data (JSON or XML) into…
- arcgis2geojsonConverts ArcGIS JSON format to GeoJSON format, supporting both string…
- kml2geojsonConverts KML files to GeoJSON format, preserving styling, folder…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also kml2geojson · overpy · osmium · topojson · arcgis2geojson · antimeridian · geojson · osmnx · staticmap · pygeoif