OpenStreetMap data

Working with OpenStreetMap itself: reading PBF extracts, points of interest, roads, rivers, land use, railways, parks, cycle lanes, charging stations and buildings, the edit history, the licence, and the tagging traps that make counts wrong.

Left, the District of Columbia outline with the 594 km of major-road ways from the OpenStreetMap extract of 1 October 2026; right, the number of building polygons in OSM inside D.C. on 1 January of every second year from 2008 to 2026, from the ohsome API: 152 in 2010, 93,850 in 2012, 160,532 in 2016 and 161,051 in 2026. a map built by people and imports: read it as data, with its history594 km of OSM major roads, 1 Oct 202620082012201620202024OSM buildings in D.C., 2008-2026 (ohsome)

OpenStreetMap is the richest open map of the world, and also a database with no fixed schema, edited by many people and tools. The guides here work with it directly: reading Geofabrik PBF extracts with pyosmium and DuckDB, and pulling out points of interest, roads, water, land use, railways, parks, cycle lanes, charging stations and building heights. They also cover exporting the results, analysing the edit history with the ohsome API, and the licence that comes with the data.

Every number comes from a run on the dated extract of Washington, D.C. of 1 October 2026. With areas enabled, pyosmium returned 24,237 amenity features where 16,960 exist; a parks-only filter missed Rock Creek Park; every one of 6,378 speed limits carried mph, so pd.to_numeric parsed none; and 99% of the District’s buildings were added in just three years, almost all of them in two bulk imports.

🧭 Start with the concepts

The ideas the how-to guides below assume you already have.

⚙️ Then do the task

Step-by-step walkthroughs with code you can copy and adapt.

Show every how-to guide in this topic

🔧 When it breaks

The errors this topic produces, with the cause explained rather than just the command.

Related topics

Subjects that keep coming up alongside this one, most overlap first.

Keep browsing

OpenStreetMap data sits in Fundamentals. Every topic on the site is listed on the topics index.