How to discover administrative level in OpenStreetMap data ?
The main question is: how to determine programmatically all the administrative levels (and names) of geocoded point ?
Data examples that should be found (from a human point of view)
Data are shown from smallest to biggest organisation.
Montpellier
- address: 5 rue du plan du palais 34000 Montpellier
- "canton" : Montpellier 5° canton (source Montpellier bureaux de vote) but really need verification and find a reliable and global source of authority
- City: Montpellier on Nominatim (OSM admin_level=7) or Montpellier on OSM (admin_level=8) ?
- Local government: Montpellier Méditerranée Métropole on Nominatim ("Montpellier 3M") tagged
local_authority:FR=metropole
- Province
admin_level=6
("Département"): Hérault in Nominatim, Hérault on OSM - Region
admin_level=4
: Occitanie in Nominatim, Occitanie on OSM
Other example elsewhere in France
TODO
Edge case example: Lyon area
- one address related to "Lyon Metropole"
- another one related to "Conseil Départemental du Rhône" (Villefranche ?)
Global design
Many things should be described by the combination of boundary=administrative
and admin_level=*
. In France, we can add the combination of type=boundary
and boundary=local_authority
and local_authority:FR=*
(see dedicated paragraph on "Tracer_les_limites_administratives")
Resources: