Cognised existence: Administrative units are territorial divisions defined by governance acts. They exist because a political authority declared them. Their boundaries determine jurisdiction, statistical aggregation, electoral geography, and service responsibility.

Question: Which administrative area does a location belong to?

OSM wiki: https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative


Realisations

OpenStreetMap — boundary=administrative

OSM carries administrative boundary relations globally, tagged with admin_level=*. The numeric level indicates hierarchical tier but the meaning varies by country.

Global admin_level conventions (varies by country):

admin_levelCommon use
2National boundary
4State / region / province
6County / department
7–8Municipality / district
9–10Sub-municipal (ward, parish)

Per-country mappings: https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative

import osmnx as ox
ox.settings.cache_folder = ".cache/"
 
# Geocode a named area to its boundary polygon
gdf = ox.geocode_to_gdf("Copenhagen Municipality, Denmark")
 
# Get all municipalities in a country
municipalities = ox.features_from_place(
    "Denmark",
    tags={"boundary": "administrative", "admin_level": "7"}
)

Overpass (fallback)

[out:json][timeout:120];
(
  relation["boundary"="administrative"]["admin_level"="7"]["ISO3166-1"="DK"];
);
out body; >; out skel qt;

Key OSM tags

TagMeaning
boundary=administrativeAdministrative boundary relation
admin_level=*Hierarchy level (country-specific meaning)
name=*Official name
name:en=*English name
ISO3166-1=*ISO country code (level 2)
ISO3166-2=*ISO sub-national code
ref=*Official code reference

Natural Earth — ne_10m_admin_0_countries, ne_10m_admin_1_states_provinces

Natural Earth provides national (ADM0) and first-level (ADM1) boundaries in Polygon form at three scales. Attributes include ISO codes, country names, and GeoUnit identifiers.

Python load

import geopandas as gpd
 
# National boundaries
countries = gpd.read_file("ne_10m_admin_0_countries.shp")
 
# First-level administrative units
regions = gpd.read_file("ne_10m_admin_1_states_provinces.shp")
 
# Filter to a single country
dk = countries[countries["ISO_A2"] == "DK"]

Key attributes (ADM0)

FieldMeaning
NAMECountry name
ISO_A2ISO 3166-1 alpha-2 code
ISO_A3ISO 3166-1 alpha-3 code
ADMINFull administrative name
CONTINENTContinent
POP_ESTPopulation estimate

De facto vs. de jure — Natural Earth layer selection

Natural Earth separates the question “who administers this territory?” (de facto) from “who claims sovereign authority?” (de jure) through a deliberate layer family. Always choose the layer that matches your analytical question.

LayerRepresentsUse when
ne_10m_admin_0_sovereigntyDe jure sovereign states only — the internationally recognised legal claimDiplomatic analysis, treaty coverage, UN membership, international law contexts
ne_10m_admin_0_countriesDe facto administrative units — how territory is actually governed on the ground todayOperational mapping, routing, administrative statistics, population attribution
ne_10m_admin_0_map_unitsFurther subdivisions of countries for cartographic clarity (e.g. Alaska shown separately)Cartographic display, atlas-style maps
ne_10m_admin_0_disputed_areasAreas where sovereignty or administration is actively contestedConflict mapping, geopolitical analysis — never use as authoritative boundary
ne_10m_admin_0_boundary_lines_landBoundary lines with a status attribute (Definite, Indefinite, Disputed, Breakaway, etc.)Displaying boundary certainty and legal status

Key principle: admin_0_countries may include territories administered by a state that does not hold de jure sovereignty over them (e.g. occupied territories, dependencies, breakaway regions). admin_0_sovereignty will attribute those same polygons to the legally recognised sovereign instead.

import geopandas as gpd
 
# De facto — who governs the ground
countries = gpd.read_file("ne_10m_admin_0_countries.shp")
 
# De jure — who holds sovereign legal claim
sovereignty = gpd.read_file("ne_10m_admin_0_sovereignty.shp")
 
# Disputed areas — use only for display/analysis of contested status
disputed = gpd.read_file("ne_10m_admin_0_disputed_areas.shp")
 
# Boundary lines with status attribute
boundaries = gpd.read_file("ne_10m_admin_0_boundary_lines_land.shp")
print(boundaries["status"].value_counts())
# -> Definite, Indefinite, Disputed, Breakaway, Claim boundary, ...

OSM note: OSM encodes the on-the-ground situation (de facto) by convention. Disputed boundaries are tagged with disputed=yes and/or border_type=*. OSM does not carry a parallel de jure geometry — for legal claim boundaries use Natural Earth admin_0_sovereignty or admin_0_disputed_areas.


Geometry Representations

Rep IDSource DatasetGeometry TypeNative CRSSuitable ForNot Suitable For
admin_osm_polygonOSM via osmnx / OverpassPolygon (relation)EPSG:4326Area queries, point-in-polygon, map display, aggregationLegal boundary disputes — OSM may lag official updates
admin_ne_10m_countriesNatural Earth 10m — de facto countriesPolygonEPSG:4326Operational global maps, statistics attribution, population linkageLegal sovereignty disputes
admin_ne_10m_sovereigntyNatural Earth 10m — de jure sovereigntyPolygonEPSG:4326Diplomatic/legal contexts, treaty and international law framingOperational routing or services in disputed territories
admin_ne_10m_disputedNatural Earth 10m — disputed areasPolygonEPSG:4326Visualising contested zones, geopolitical analysisAny authoritative administrative attribution
admin_ne_50m_polygonNatural Earth 50mPolygonEPSG:4326World-view context mappingRegional or local detail

Limitations

  • OSM administrative boundaries may lag official updates (elections, boundary changes).
  • admin_level values are country-specific — always check the OSM wiki for the country in question.
  • Boundary quality is highest in Europe and North America; variable elsewhere.
  • Natural Earth admin_0_countries represents de facto administration, not de jure sovereignty — they diverge for ~20–30 territories globally (occupied areas, breakaway states, dependencies). Always confirm which layer is appropriate for the analytical context before use.