Skip to content

IDs & kinds

Stable ids you can store, and one vocabulary for places across countries.

Boundary ids

A boundary's id is its OpenStreetMap id: r plus the relation id, or w plus the way id. It's stable, and you can open any boundary on openstreetmap.org to check it. Inputs accept these forms; responses always use the canonical one:

InputMeaning
r62422Canonical: an OSM relation (Berlin)
w123456Canonical: a boundary drawn as one closed OSM way
zcta-11249Canonical: a US ZIP code area (Census ZCTA, not from OSM)
zcta:11249, zip:11249, ZCTA5 11249Spellings of a ZIP code area id
tz-america-new_yorkCanonical: an IANA time zone (timezone-boundary-builder, from OSM data; + is spelled plus: tz-etc-gmtplus5)
America/New_York, tz:America/New_YorkSpellings of a time zone id
eez-8456Canonical: an Exclusive Economic Zone by its Marine Regions id (not from OSM)
eez:8456, mrgid:8456Spellings of a maritime zone id
cbsa-35620, csa-408Canonical: a US metro or micro area by its CBSA code, a combined statistical area by its CSA code (Census TIGER/Line)
cd-3610Canonical: a US congressional district of the current Congress, state FIPS + district (NY-10; 00 at-large, 98 a delegate)
sd-0622710Canonical: a US school district (unified, elementary or secondary) by its NCES LEA id
cdp-1208150Canonical: a US census-designated place, an unincorporated community, by its place GEOID
cbsa:35620, CD 3610, sd:0622710Spellings of a Census area id
wof-85857853Canonical: a neighbourhood outline from Who's On First, by its WOF id (not from OSM)
wof:85857853, whosonfirst:85857853Spellings of a neighbourhood outline id
ons-E05013809Canonical: a UK electoral ward, Westminster constituency or census area by its ONS GSS code (not from OSM)
ons:E05013809, gss:E05013809, E05013809Spellings of a UK area id
R62422, relation/62422, rel 62422Common spellings
-62422osm2pgsql's negative relation ids
https://www.openstreetmap.org/relation/62422An osm.org URL
wikidata:Q64A Wikidata item
iso:US-CA, iso:DEISO 3166-2 or 3166-1 code

Wikidata and ISO ids are looked up once, then answered from our table.

Kinds

OSM's admin_level means different things per country: level 4 is a US state, a French region and a Japanese prefecture; level 8 is a German Gemeinde and a US city. Each boundary also has a kind from one vocabulary, so you can filter the same way everywhere:

country, state, region, province, county, district, municipality, city, borough, ward, neighbourhood, postal_code, airport, timezone, eez, metro_area, micro_area, combined_statistical_area, congressional_district, school_district, census_place, constituency, census_area.

Level 2 is always country, and postcode areas are postal_code. Time zones (timezone) and Exclusive Economic Zones (eez) have no level: they cover the world as layers of their own, and reverse_boundaries lists them after a point's chain. So do the US Census areas: metro_area, micro_area, combined_statistical_area, congressional_district, school_district and census_place (a census-designated place). Below that, a sample:

CountryLevel 4Level 5Level 6Level 7Level 8Level 9Level 10
USstateregioncountymunicipalitycitywardneighbourhood
GBregionregioncountydistrictdistrictwardward
DEstateregiondistrictmunicipalitymunicipalityboroughneighbourhood
FRregionregioncountydistrictmunicipalityboroughneighbourhood
ESregionregionprovincedistrictmunicipalitydistrictneighbourhood
JPprovinceregioncountymunicipalityboroughneighbourhoodneighbourhood
INstatedistrictdistrictdistrictcitywardneighbourhood
BRstateregioncountyregionmunicipalitydistrictneighbourhood
AUstateregionmunicipalitydistrictmunicipalityneighbourhoodneighbourhood
Otherstateregioncountydistrictmunicipalityboroughneighbourhood

A municipality OSM tags as a city becomes city. Filter search with kind, or with admin_level when you need OSM's own level.