[openstreetmap/openstreetmap-website] Use admin_level from extratags when classifying Nominatim search results (PR #7021)

Sarah Hoffmann notifications at github.com
Mon Apr 20 12:39:14 UTC 2026


### Description

One of the fallbacks for determining the category of a search result requires to know about the `admin_level`. So far this was guessed from the address rank which is not quite right. Nominatim now exports the original `admin_level` [in the extra tags](https://github.com/osm-search/Nominatim/issues/4019), so use that instead.

Fixes #6870.

### How has this been tested?

Only verified that "Sluis" from the original issue now reports as admin level 8:

<img width="452" height="500" alt="sluis" src="https://github.com/user-attachments/assets/07b3152c-bf55-4f5e-ad5c-1be9424ace00" />

You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/7021?email_source=notifications&email_token=AAK2OLIBBGPADKXLLYSXJTD4WYK7FA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTKNJVHA4TSMRSGCTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVVYHEX3POBSW4X3DNRUWG2Y

-- Commit Summary --

  * use admin_level from extratags when classifying Nominatim search results

-- File Changes --

    M app/controllers/searches/nominatim_queries_controller.rb (6)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/7021.patch?email_source=notifications&email_token=AAK2OLIETZUS3O2YKQITU2D4WYK7FA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTKNJVHA4TSMRSGCTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZYHEX3QMF2GG2C7MNWGSY3Lhttps://github.com/openstreetmap/openstreetmap-website/pull/7021.diff?email_source=notifications&email_token=AAK2OLKWAY7BIFLTW7U3XPL4WYK7FA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTKNJVHA4TSMRSGCTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVVYHEX3ENFTGMX3DNRUWG2Y
-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7021
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/7021 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260420/86fd3d34/attachment.htm>


More information about the rails-dev mailing list