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
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.

Level 2 is always country, and postcode areas are postal_code. 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.