querying a tag with a ":" colon in the tag
Closed this issue · 5 comments
We are in the process of defining a new tag to describe bars, cafés, restaurants, hotels, etc participating in free water bottle refills schemes to combat single-use plastic waste, and the tag that is under consideration contains a colon - ":".
When I try to pass that to the query_overpass function, I get a 400 error. Is there a way to encode this character in the query ?
I hope my question is clear.
Best regards,
Stuart
Hi there, not sure if this is an issue with query-overpass or the API itself, but can you provide the query in question so I can understand better?
I really appreciate your help. Thanks for responding. Sorry for not being clearer.
Below, you will find the overpass turbo query which I did on the web. There is only one instance of this experimental tag- which I put at way=111556897#map=18/46.26914/5.86995, as it is still be developed in collaboration with OSM.
Best regards,
Stuart
/*
This has been generated by the overpass-turbo wizard.
The original search was:
*/
[out:json][timeout:25000];
// gather results
(
// query part for: “amenity=prison”
node["drinking_water:refill"="yes"]({{bbox}});
way["drinking_water:refill"="yes"]({{bbox}});
relation["drinking_water:refill"="yes"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
I think the issue is that you left {{bbox}}
in the query instead of replacing it with an actual bounding box.
I saved the following query to a file and ran it succesfully:
(
// query part for: “amenity=prison”
node["drinking_water:refill"="yes"](46.1,5.8,46.3,5.9);
way["drinking_water:refill"="yes"](46.1,5.8,46.3,5.9);
relation["drinking_water:refill"="yes"](46.1,5.8,46.3,5.9);
);
// print results
out body;
>;
out skel qt;
cat overpass-query-42 |npx query-overpass
{"type":"FeatureCollection","features":[{"type":"Feature","id":"way/111556897","properties":{"type":"way","id":111556897,"tags":{"addr:city":"La Pesse","addr:postcode":"39370","addr:street":"route de la Borne au Lion","building":"yes","drinking_water:refill":"yes","email":"no-made-attitude@wanadoo.fr","name":"Refuge Le Berbois","phone":"+33 3 84 42 72 41","tourism":"guest_house","website":"http://www.leberbois.com"},"relations":[],"meta":{}},"geometry":{"type":"Polygon","coordinates":[[[5.8688219,46.2696549],[5.8688564,46.2695359],[5.8690324,46.2695603],[5.8689979,46.2696793],[5.8688219,46.2696549]]]}}]}
Thank you for your response. It looks promising. I am in the French Pyrenees near the Spanish border without wifi access ... and no nearby cafe with access. I will respond Monday with hopefully a positive resolution . I'll let you know what I was doing wrong as well. Thx again.
Thanks again ! Stuart https://europeanwaterproject.org
It works. I had a syntax error. Thanks for your help. I really appreciate it and this great code for extracting data via the overpass API. Best regards, Stuart