You are not logged in.

Announcement

*** NOTICE: forum.openstreetmap.org is being retired. Please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators.
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***

#1 2021-08-01 04:29:55

jmelvin
Member
Registered: 2021-06-29
Posts: 14

Query for tags does not return all matches

I checked the tags on Bourbon Street Pub in Key West FL and it definitely includes lgbtq:primary.  However, a valid search for the tag does not return any matches...

https://lz4.overpass-api.de/api/interpreter?data=[out:json];(node(around:50000,24.5557,-81.78259)["lgbtq"~"primary|friendly"];);out skel qt;

It does not find a match on the official server above or my new local instance.  What could be wrong?  I'm wondering if other places in other geos are also missed.  Hoping it's a simple query adjustment.

Not sure if it matters, but the pub is listed as a building and I'm searching for a node.

Offline

#2 2021-08-01 10:00:30

alan_gr
Member
Registered: 2017-11-27
Posts: 128

Re: Query for tags does not return all matches

I think you almost answered your own question at the end - if you want to find all objects with the tag, you need to query for ways and relations as well as nodes.

Offline

#3 2021-08-02 06:02:32

jmelvin
Member
Registered: 2021-06-29
Posts: 14

Re: Query for tags does not return all matches

Thank you @alan_gr!  Indeed there are some businesses with tags only on ways and/or relations.  I have found some that tag all three, e.g. Your CBD Store Brookline...

https://lz4.overpass-api.de/api/interpreter?data=[out:json];(nwr(around:50000,42.6662357,-71.0949206)["shop"~"cannabis"];);out center qt;

This will return 5 results, 3 of which are the same business... "Your CBD Store Brookline"... 1 result for node, 1 for way and 1 for relation.

Question: Does the overpass API provide a way to dedup such results?

Offline

#4 2021-08-02 14:45:33

Mateusz Konieczny
Member
Registered: 2013-09-22
Posts: 2,698

Re: Query for tags does not return all matches

jmelvin wrote:

Question: Does the overpass API provide a way to dedup such results?

No, but if something is duplicated then it should fixed in OSM data.

I just did it there

Offline

#5 2021-08-02 15:30:06

jmelvin
Member
Registered: 2021-06-29
Posts: 14

Re: Query for tags does not return all matches

Thanks @Mateusz Konieczny for the reply and the fixup.

Because we are searching for tags in nodes, ways and relations (a.k.a 'nwr'), our app can easily identify duplicates in our deduplicate() method in the results.  How exactly did you correct the OSM data?  Can this be done using the iD editor?  As we find dups, we can do the same and incrementally improve the data over time.

Offline

Board footer

Powered by FluxBB