[Photon] Rank address and city
Sarah Hoffmann
lonvia at denofr.de
Sun Dec 26 16:28:32 UTC 2021
Hi,
On Fri, Dec 24, 2021 at 08:35:49AM +0100, Hendrik Moree wrote:
> Some places in the Netherlands have a rank_address in nominatim that
> doesn't match with a city in Photon. (Most places are correct btw)
That's very likely data issues. Good candidates to look at are
wikidata tags and place nodes.
> For example https://www.openstreetmap.org/relation/163550. This one has
> admin_level 10 which (in the Netherlands) always is the city name. But
> because Photon is based on rank_address this ends up wrong. rank_search
> seems to be more realistic in this case.
>
> nominatim=# select rank_search, rank_address, admin_level from placex where
> osm_type = 'R' and osm_id = 163550;
> rank_search | rank_address | admin_level
> -------------+--------------+-------------
> 16 | 22 | 10
The problematic relation here is: https://www.openstreetmap.org/relation/163548
It has a wikidata tag that points to Bunschoten. In addition, there are
two nodes that have the same wikidata tag as well:
https://www.openstreetmap.org/node/5435880522 (a town)
https://www.openstreetmap.org/node/45841911 (a suburb)
Nominatim cannot sort out correctly which belongs to what with that
information.
Given that the boundaries are not exactly the same, one of the two
relations and one of the two nodes should not carry the wikidata tag.
> For example this one, which seems to be comparable is okay:
> https://www.openstreetmap.org/relation/271169
> But the rank_address is 0
> nominatim=# select rank_search, rank_address, admin_level from placex where
> osm_type = 'R' and osm_id = 271169;
> rank_search | rank_address | admin_level
> -------------+--------------+-------------
> 16 | 0 | 10
This looks to be one of the cases where the admin_level 8 and 10 are in
fact the same entity. (So it's correct to have again the same wikidata
tag on both relations.) Most countries map this by leaving out one of the
boundaries but Nominatim will handle the duplication as well. It moves
the level 8 boundary to city level (address rank 16):
https://nominatim.openstreetmap.org/ui/details.html?osmtype=R&osmid=418793&class=boundary
And then 'deletes' the admin_level 10 boundary from the address
hierarchies by setting address rank to 0.
So this all works as intended and should get you the right results in
the address hierarchy.
> Who is wrong in the case of Bunschoten - Spakenburg? Is it OSM, Nominatim,
> Photon?
> Can anyone explain how the rank_address is determined?
There is a shorter blog post here:
https://nominatim.org/2020/11/11/places-and-boundaries.html
And I've held a talk at SOTM this year which tries to explain this:
https://www.youtube.com/watch?v=NAzljx1ewZ0
Sarah
More information about the Photon
mailing list