You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Search results are assigned to anachronistic countries #1403
The “address” or display name that Nominatim calculates for each result comes up with a country that is often anachronistic. For example, searching for “Cafe du Monde” turns up this American-brand café [2009 – 2011] supposedly located in the Empire of Japan [1920 – 1925]. (The empire’s name still has a date range in its name=* tag, which is incorrect, but at least it makes this bug more apparent.)
Nominatim knows that this result is in Japan. For performance at admin level 2, it falls back to a country grid derived from OSM. This grid returns jp, which Nominatim then converts to a country and associates with a boundary relation for its names. Somewhere in this process, when we’re deciding which country to include in the address for a particular result, we would at least need to filter the results by a matching date in extratags. But it would be better to disable this country grid altogether, since it isn’t possible to make a distinct country grid for all the different country configurations over the course of history.
osm-search/Nominatim#3516 says the country grid is only used for tie-breaking when a feature is in multiple overlapping admin_level=2 boundaries. (I think it also assumes every country has a country code, which is a larger problem.) We can add the check for matching dates to this SQL query.
This feels like a clearer example of what's going on in this ticket. The Carolingian Empire was definitely long gone by the dates shown at the end of the search results.
Here, several results are assigned to the "United States" before the United States existed. This result should be listed under the Colony of Pennsylvania.
Activity
1ec5 commentedon Jul 28, 2026
osm-search/Nominatim#3516 says the country grid is only used for tie-breaking when a feature is in multiple overlapping
admin_level=2boundaries. (I think it also assumes every country has a country code, which is a larger problem.) We can add the check for matching dates to this SQL query.jeffreyameyer commentedon Dec 3, 2026
Additional examples to use in testing (if necessary)
Tenochtitlan
This example is odd, because it's not clear to me how any Haiti boundary would enclose Tenochtitlan.
Danzig
This feels like a clearer example of what's going on in this ticket. The Carolingian Empire was definitely long gone by the dates shown at the end of the search results.
Cumberland County
Here, several results are assigned to the "United States" before the United States existed. This result should be listed under the Colony of Pennsylvania.