Hi,
apologies for posting in English. I have added a translation by DeepL below, but I cannot even judge if it is useful.
I’m currently reworking how the search engine Nominatim handles administrative
boundaries to form addresses. One of the issues that I have tried to solve is
the issue of admin levels and cities. To give you an example waht I mean:
in Poland admin_level 6 corresponds to ‘country’. But large cities like Krakow
have admin_level 6, too.
Nominatim now solves this by looking at place nodes. If there is an administrative
boundary with admin_level 6 that contains a related place node with place=city,
then the boundary is classified as city. This works pretty well, except for
Poland. You have decided to duplicate the administrative boundaries for levels
that are missing. These duplicates cause problems.
I have reindexed all of Koszalin[1] on nominatim.openstreetmap.org in order to
show you the problem. Take a random street in Koszalin:
https://nominatim.openstreetmap.org/ui/details.html?osmtype=W&osmid=275110865&class=building
You can see that Nominatim has correctly figured out that the admin_level 6
describes a city (= address rank 16). So far so good. But then another rules
comes in: it knows that admin_levels describe a perfect hierarchy. It now finds
a boundary with admin_level 7. It cannot be a city anymore, so it must be a
city borough (= address rank 18). The same happens with admin_level 8. It is
inside a city borough, so it must be a suburb (= address rank 20).
I can (and will) add a rule that detects these duplicates (most likely by
comparing the wikidata tag). Still, I wanted to make you aware that this
duplication of boundaries is a rare exception in OSM. All other countries I
have looked at so far create exactly one boundary and usually set it to the lowest
applicable admin_level. More consistency would be useful. So maybe you can
revisit your decision and see if the duplication is still necessary today.
[1] Most data on nominatim.openstreetmap.org is still indexed according to the
old algorithm. You will not see the same effect in other cities.
Kind regards
Sarah
–
Translation by DeepL:
Obecnie pracuję nad tym, jak wyszukiwarka Nominatim obsługuje administrację
granice do tworzenia adresów. Jedną z kwestii, które próbowałem rozwiązać jest
kwestia poziomów administracyjnych i miast. Żeby dać ci przykład, o co mi chodzi:
w Polsce admin_level 6 odpowiada “krajowi”. Ale duże miasta jak Kraków
mają też admin_poziom 6.
Nominatim rozwiązuje to teraz, patrząc na węzły miejsca. Jeśli istnieje administracyjny
granica z admin_level 6, który zawiera powiązany węzeł miejsca z place=city,
wtedy granica jest klasyfikowana jako miasto. To działa całkiem nieźle, z wyjątkiem
Polska. Zdecydowaliście się na powielenie granic administracyjnych dla poziomów
które zaginęły. Te duplikaty powodują problemy.
Przekindeksowałem cały Koszalin[1] na nominatim.openstreetmap.org w celu
pokazać ci problem. Weź losową ulicę w Koszalinie:
https://nominatim.openstreetmap.org/ui/details.html?osmtype=W&osmid=275110865&class=building
Widzisz, że Nominatim poprawnie zorientował się, że admin_level 6
opisuje miasto (= stopień adresowy 16). Na razie dobrze. Ale potem inne zasady
wchodzi: wie, że poziomy admin_levels opisują doskonałą hierarchię. Teraz znajduje
granica z admin_poziomem 7. To już nie może być miasto, więc musi to być
gmina miejska (= stopień adresowy 18). To samo dzieje się z admin_level 8. Jest to
wewnątrz dzielnicy miejskiej, więc musi to być przedmieście (= adres rangi 20).
Mogę (i będę) dodać regułę, która wykryje te duplikaty (najprawdopodobniej przez
porównując znacznik wikidata). Mimo to, chciałem ci uświadomić, że to
powielanie granic jest rzadkim wyjątkiem w OSM. Wszystkie inne kraje I
jak do tej pory stworzyli dokładnie jedną granicę i zazwyczaj ustawili ją na najniższą
obowiązujący poziom admin_level. Przydałaby się większa spójność. Więc może uda ci się
zrewidować swoją decyzję i sprawdzić, czy powielanie jest jeszcze dziś konieczne.
[1] Większość danych na nominatim.openstreetmap.org jest nadal indeksowana zgodnie z normą
stary algorytm. Nie zobaczysz tego samego efektu w innych miastach.