Skip to content

Nominatim doesn't seem to be returning features it *should* (?) #243

Closed

Description

@jeffreyameyer

Bug description
What is happening?
When I search for strings clearly contained in names of relations, not all relevant relations are getting returned. This could be a data / tagging issue, but I'm not sure...

e.g., search for "Oregon" doesn't return the Oregon Territory
https://www.openhistoricalmap.org/search?query=oregon#map=7/44.953/-120.904&layers=O&date=1917&daterange=1800,2021
image

e.g., search for "Romania" doesn't return... numerous... relations with Romania in the title...
https://www.openhistoricalmap.org/search?query=romania#map=6/43.079/35.502&layers=O&date=1917&daterange=1800,2021
image

What should be happening?
All relevant relations, ways, and nodes containing the name Virginia should be returned... something closer to this:
https://www.openhistoricalmap.org/search?query=virginia#map=7/38.285/-81.541&layers=O&date=1917&daterange=1800,2021
image

or this:
https://www.openhistoricalmap.org/search?query=texas#map=6/30.708/-97.971&layers=O&date=1917&daterange=1800,2021
image

Repro Steps
Please provide detailed instructions to reproduce the behavior:

  1. Go to www.openhistoricalmap.org
  2. Play with search terms you think would turn up a lot of results (e.g., Oregon, Romania)
  3. Compare the results to what you think should be there.

Activity

  1. danrademacher commented on Jun 17, 2021

    @danrademacher

    My first thought is that we should make sure that the missing results form Nominatim are actually present in the Nominatim database. And if not, whether that's the result of a recurring bug or some one-off issue with importing data when we first set this up.

    One way we could test that would be to edit one of these missing items, wait a few minutes and see if the search results are better. Not a good solution at scale, but it would narrow the problem.

    I just did that here: https://www.openhistoricalmap.org/changeset/20321

    Let's see if in a few minutes, that search result appears.

    Ah, but drat, I see that Hadrian's Wall was edited within 40 minutes and 1 minute of Jeff's confirming them ABSENT from Nominatim results.

    So this seems definitely a current and recurring bug and not some artifact of setup. Then next Q is if

    1. those results exist in Nominatim database but are not being returned for some reason
    2. those results are not being written into Nominatim for some reason.
  2. geohacker commented on Jun 18, 2021

    @geohacker

    One way we could test that would be to edit one of these missing items, wait a few minutes and see if the search results are better. Not a good solution at scale, but it would narrow the problem.

    @danrademacher I think a better way to do this to query the nominatim database for those OSM IDs. We can check this next week. My hunch is that we might need tweak the import tag collection but I'm not sure.

  3. jeffreyameyer commented on Oct 11, 2021

    @jeffreyameyer
    MemberAuthor

    Team - Nominatim still isn't returning reliable results.

    Test it for yourself.

    Try searching for Comancheria... see what happens. 😢

    What can we do to get this fixed?

  4. geohacker commented on Oct 12, 2021

    @geohacker

    Ah damnit, sorry about this @jeffreyameyer @danrademacher. Let me chat with @Rub21 today and take a look at logs and the current state of the db. Will come back here with a plan shortly.

  5. geohacker commented on Oct 12, 2021

    @geohacker

    Digging into this a little more:

    1. The Comancheria relation is this https://www.openhistoricalmap.org/relation/2692912
    2. The node is https://www.openhistoricalmap.org/node/2090973384
    3. I confirmed that both exists in the Nominatim DB
    4. Tried a search like this https://openhistoricalmap.org/search?query=Comancheria%20(1750-1860)#map=7/34.751/-100.625&layers=O&date=1750&daterange=1750,1860 and it does show
    5. Notice that the Comancheria name is Comancheria (1750-1860) with the years in paranthesis

    I'm surprised that nominatim doesn't offer the result when the search term is just Comancheria.

  6. geohacker commented on May 26, 2022

    @geohacker

    @jeffreyameyer Sorry yes this is still a problem. We haven't investigated yet why Nominatim isn't able to surface these results. I'll put this on my list and update here what I find.

  7. jeffreyameyer commented on May 27, 2022

    @jeffreyameyer
    MemberAuthor

    Btw... we seem to have had a regression of functionality here. Compare the current search results for "Virginia" now:

    image

    to what it was earlier in this ticket:
    image

  8. danrademacher commented on Jun 14, 2022

    @danrademacher

    Still looks like we have some issues with how those names are coming back. The results for "comancheria" and "Comancheria (1750-1860)" look correct, but the "Virginia" results are mixed with Comancheria.

    In the first link, the first result looks like this in JSON payload:

      {
        "place_id": 148476,
        "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
        "osm_type": "node",
        "osm_id": 2091371553,
        "boundingbox": [
          "36.5135514",
          "41.7135514",
          "-86.7254",
          "-81.5254"
        ],
        "lat": "39.1135514",
        "lon": "-84.1254",
        "display_name": "Virginia, Comancheria (1750-1860)",
        "place_rank": 8,
        "category": "place",
        "type": "state",
        "importance": 0.66
      }

    So we have "display_name": "Virginia, Comancheria (1750-1860)", which is unexpected since Comancheria was distant from Virginia, but I thought well maybe Virginia claimed a huge area or something, so I looked at the node:
    https://openhistoricalmap.org/node/2091371553

    It is far away from where I would expect, over in present-day Ohio. But it's also clearly tagged as "Virginia", so how does the display name get to be "Virginia, Comancheria (1750-1860)"?

    The last item in the Virginia search includes:
    "Virginia, Nevada Territory (1861-62), Comancheria (1750-1860)",

    Aha, and this is a town in Nevada:
    https://openhistoricalmap.org/node/2093762263#map=8/39.309/-119.649&layers=O&date=1900&daterange=1800,2022

    So "Virginia, Nevada Territory (1861-62)" is correct.

    But Comancheria doesn't contain either the town Virginia or the State of Virginia:
    image

    https://openhistoricalmap.org/relation/2692912#map=7/34.751/-100.625&layers=O&date=1900&daterange=1800,2022

    I wonder if there is something wrong with the geometry of Comancheria that causes Nominatim to think it contains objects that don't seem to be inside its borders.

    Nevada thinks it is inside Comancheria:
    http://a98f8e4c7b1c444c29184586f15cd5b6-440193567.us-east-1.elb.amazonaws.com/search.php?q=Nevada

    As do many places in California:
    http://a98f8e4c7b1c444c29184586f15cd5b6-440193567.us-east-1.elb.amazonaws.com/search.php?q=California

    I feel like there's got to be some issue with the geometry of that shape -- or maybe the interaction of that shape with the internals of Nominatim. But I am not sure what!

  9. geohacker commented on Jun 15, 2022

    @geohacker

    @Rub21 thank you! This is progress.

    @danrademacher the display name is a combination of name tags to create an address string which nominatim prepares. So this is expected. I pulled both the relations into JOSM and can confirm the behaviour is expected:

    image

    The virginia relation is admin_level: 4 and the Comancheria relation is admin_level: 2. So that's where the display name is coming from.

    Perhaps there's an error in the admin_levels?

  10. jeffreyameyer commented on Sep 22, 2022

    @jeffreyameyer
    MemberAuthor

    Looks like the updates @Rub21 delivered are making progress here.

    There is still 1 case in this ticket that's not working:

    • Hadrian's Wall

    image

    image

    image

    image

    Closing this ticket & will reopen one with Hadrian's Wall (my guess is the apostrophe is causing issues...)

  11. added theissue type on Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions