Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Country filter does not filter only countries #9540

Closed
matkoniecz opened this issue May 24, 2024 · 5 comments
Closed

Country filter does not filter only countries #9540

matkoniecz opened this issue May 24, 2024 · 5 comments
Labels
nsi.guide An issue with the https://nsi.guide site

Comments

@matkoniecz
Copy link
Contributor

matkoniecz commented May 24, 2024

https://nsi.guide/index.html?t=brands&k=amenity&v=atm&cc=pl

I would expect it to show global entries and ones in Poland.

screen07
screen06

Instead it includes also other entries like

https://github.com/osmlab/name-suggestion-index/blob/main/data/brands/amenity/bank.json#L9510

    {
      "displayName": "People's United Bank",
      "id": "peoplesunitedbank-28419b",
      "locationSet": {
        "include": [
          "peoples_united_bank_ct.geojson"
        ]
      },
      "tags": {
        "amenity": "bank",
        "brand": "People's United Bank",
        "brand:wikidata": "Q7165802",
        "name": "People's United Bank"
      }
    },

not within Poland.

(maybe these get in due to geojson-specified area, obnoxious to filter by country code? But then maybe it can show up with note, not with random pl being highlighted?)

@mnalis
Copy link
Contributor

mnalis commented May 24, 2024

I'd guess the quick fix for this particular problem would be that website does not match country as pl but as "pl instead - "pl" (with the trailing quote) would produce even less false positives, but would also prevent matching things like "gb-sct".


However, it seems that https://nsi.guide/ website only does the simplest matching for that country in entered, i.e. if you entered specific country code, it won't match:

  1. things that are present it whole world - e.g. searching for amenity=parcel_locker in pl will not find GLS, even if it has [{"include":["001"]}] (i.e. whole world)
  2. any other UNM_49 numeric codes (like e.g. "039" for Southern Europe)
  3. manually defined polygons as in that example, wikidata QIDs, and other more complex cases like e.g. that specific one peoples_united_bank_ct.geojson

While the first (whole world) could be added relatively easily manually, second is noticeably harder, and third near impossible.

I'm not sure if implement just 1. would make it less confusing, although it would cover many popular cases. Wiki lists @ideditor/location-conflation which perhaps could be used for more complete country-matching support.

How much work that would be implementing that (including detecting country polygon crossing manually specified polygon to get full support), I don't know... Perhaps UI should then be changed so that instead of typing a country code, you pick a single point on the map, and it finds all polygons that this point is inside...


What is more confusing to me is why it is showing you "People's United Bank" which is marked as dissolved, and you have not checked "Dissolved" checkbox.

@matkoniecz
Copy link
Contributor Author

What is more confusing to me is why it is showing you "People's United Bank" which is marked as dissolved, and you have not checked "Dissolved" checkbox.

It also confused me - but this checkbox causes NSI to list solely dissolved ones. If I understood it right.

@bhousel
Copy link
Member

bhousel commented May 24, 2024

Yeah - nsi.guide is really just a site I threw together. It's not like a fully featured "product".

I think when I originally made it, the index was still using country codes, and we hadn't switched to using the locationSet yet (which supports sub-country regions and other include/exclude situations).

@bhousel bhousel added the nsi.guide An issue with the https://nsi.guide site label May 25, 2024
@peternewman
Copy link
Collaborator

I think this is just a duplicate of #4077 isn't it?

@matkoniecz
Copy link
Contributor Author

Yep, duplicate of #4077

@matkoniecz matkoniecz closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nsi.guide An issue with the https://nsi.guide site
Projects
None yet
Development

No branches or pull requests

4 participants