OpenStreetMap (OSM) is a collaborative, freely editable global map. All data is available under the Open Database Licence (ODbL). It is the primary global source for roads, buildings, land use, waterways, points of interest, and administrative boundaries.

OSM wiki Map Features reference: https://wiki.openstreetmap.org/wiki/Map_features

OSM data is tag-based. Every feature is described by key–value pairs (e.g. highway=residential, building=yes, amenity=school). The Map Features page is the canonical reference for which tags exist and what they mean.


Service Types

1. Tile Services (Raster Basemaps)

OSM provides raster map tiles via the standard XYZ/slippy map scheme. Use for basemaps in interactive web maps.

EndpointFormatCRSAuth
https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.pngPNG raster tilesEPSG:3857 (Web Mercator)None

Usage notes:

  • Tile usage policy requires a valid User-Agent header and attribution: © OpenStreetMap contributors.
  • For heavy production use, self-host tiles or use a tile provider (Mapbox, Stamen, CartoDB, etc.) rather than hammering the OSM tile CDN.
  • In Leaflet: L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' })

Service family: wmts (XYZ tiles) Auth mode: None


2. Geofabrik Downloads (Bulk Vector Data)

Geofabrik provides regularly updated OSM extract downloads by region (continent → country → sub-region). Recommended for bulk analysis of a specific area.

Available formats: .osm.pbf (recommended), .osm.bz2, .shp.zip (pre-split by feature type)

Shapefile layers in the .shp.zip package:

LayerFeature TypeKey OSM Tags
gis_osm_roads_free_1LineStringhighway=*
gis_osm_buildings_a_free_1Polygonbuilding=*
gis_osm_landuse_a_free_1Polygonlanduse=*
gis_osm_waterways_free_1LineStringwaterway=*
gis_osm_water_a_free_1Polygonnatural=water, waterway=*
gis_osm_natural_free_1Pointnatural=*
gis_osm_natural_a_free_1Polygonnatural=*
gis_osm_places_free_1Pointplace=*
gis_osm_pofw_free_1Pointamenity=place_of_worship
gis_osm_pois_free_1Pointamenity=*, shop=*, tourism=*
gis_osm_pois_a_free_1Polygonsame as above
gis_osm_railways_free_1LineStringrailway=*
gis_osm_traffic_free_1Pointtraffic features
gis_osm_transport_free_1Pointpublic transport stops

CRS: WGS84 (EPSG:4326) Auth mode: None — free download Service family: filedownload


3. Overpass API (Query-Based Feature Extraction)

The Overpass API allows querying specific OSM features by tag, bounding box, or named area. Use for targeted feature extraction rather than bulk download.

Recommended approach: use OSMnx and let it manage the endpoint.

Per the project template workflow preference (workflow-preferences.yaml: osm.preferred_fetch_library: osmnx):

  • Use osmnx as the default Python library for OSM queries.
  • Configure caching: ox.settings.cache_folder = ".cache/".
  • Do not hardcode an Overpass endpoint — let osmnx choose based on its defaults.
  • Use raw Overpass queries only as a fallback or for reproducible low-level debugging.

osmnx quick reference:

import osmnx as ox
ox.settings.cache_folder = ".cache/"
 
# Road network
G = ox.graph_from_place("Copenhagen, Denmark", network_type="drive")
 
# Building footprints
buildings = ox.features_from_place("Copenhagen, Denmark", tags={"building": True})
 
# Administrative boundary
area = ox.geocode_to_gdf("Copenhagen Municipality, Denmark")
 
# Custom tag query (e.g. parks)
parks = ox.features_from_place("Copenhagen, Denmark", tags={"leisure": "park"})

Direct Overpass query (fallback):

[out:json][timeout:60];
area["name"="Copenhagen"]["admin_level"="7"]->.searchArea;
(
  way["building"](area.searchArea);
  relation["building"](area.searchArea);
);
out body; >; out skel qt;

Public Overpass endpoints:

EndpointNotes
https://overpass-api.de/api/interpreterMain public endpoint (osmnx default)
https://overpass.kumi.systems/api/interpreterMirror

Service family: overpass (treat as API query) Auth mode: None


CRS Summary

ContextCRS
Vector data (downloaded / Overpass)EPSG:4326 (WGS84)
Raster tilesEPSG:3857 (Web Mercator)
osmnx graph nodesEPSG:4326 (lat/lng stored as node attributes)

Transform to local CRS (e.g. EPSG:25832 for Denmark) using GeoPandas: gdf.to_crs("EPSG:25832").


Attribution

All OSM data must be attributed: © OpenStreetMap contributors, licensed under ODbL. Derived databases must also be released under ODbL.


Covered Leaves (semanticgis.org)

LeafPrimary OSM Tag(s)
Buildingsbuilding=*
Transport Networkshighway=*, railway=*, aeroway=*
Administrative Unitsboundary=administrative + admin_level=*
Freshwater Bodieswaterway=*, natural=water
Geographical Namesname=*, place=*
Nature Protection Areasboundary=protected_area, leisure=nature_reserve
Forest Coverlanduse=forest, natural=wood
Agriculturelanduse=farmland, landuse=meadow, landuse=*
Business Locationsamenity=*, shop=*, office=*
Energy Infrastructurepower=*
Habitat Extentnatural=wetland, natural=heath, natural=scrub
Populated Areas and Settlementsplace=city|town|village|hamlet

0 items under this folder.