westnordost / osmfeatures

A dictionary of OSM map features, accessible by terms and by tags, for Java and Android.
Apache License 2.0
18 stars 9 forks source link

Add support for lat, lon pairs with optional radius #21

Open peternewman opened 1 year ago

peternewman commented 1 year ago

Most notably as an exclude for Burger King: https://nsi.guide/index.html?t=brands&k=amenity&v=fast_food&tt=burger%20king#burgerking-890dec

Which is due to: https://en.wikipedia.org/wiki/Burger_King_(Mattoon,_Illinois)

Here's where it's skipped: https://github.com/westnordost/osmfeatures/blob/6cc75f51544613657e9a1489f54d05dfb711eaf1/library/src/main/java/de/westnordost/osmfeatures/IDPresetsJsonParser.java#L107-

There seems to be around 300 includes and 5 excludes (these give the total numeric rows so divide by about three, and assumes only one per preset): jq ".presets[].locationSet.include | arrays" nsi-id-presets.json | grep -v geojson | grep -v "\"" | grep -v "\[" | grep -v "\]" | wc -l jq ".presets[].locationSet.exclude | arrays" nsi-id-presets.json | grep -v geojson | grep -v "\"" | grep -v "\[" | grep -v "\]" | wc -l

SC could possibly just drop the exclude ones in the same way as as it drops the subdivisions of lots of ISO 3166-2 countries already which would fix the Burger King case at least. Maybe it could also find out which country the lat/lon was in and convert an include to the entire country as an interim measure.

westnordost commented 1 year ago

This would require to change the interface of the API, as currently not a geo location is supplied, but a country code.

peternewman commented 1 year ago

This would require to change the interface of the API, as currently not a geo location is supplied, but a country code.

Ah, in which case as a temporary measure, could SC not tweak it's pre-processing?

SC could possibly just drop the exclude ones in the same way as as it drops the subdivisions of lots of ISO 3166-2 countries already which would fix the Burger King case at least. Maybe it could also find out which country the lat/lon was in and convert an include to the entire country as an interim measure.

Showing Burger King either in everywhere but the US, or ALL of the US including Mattoon would probably be a better situation than not at all in the short term. Given similar stuff already happens when simplifying subdivisions.

westnordost commented 1 year ago

To be clear, the above was just a note after a cursory look, this ticket remains a valid feature request.