overpass turbo questions

  1. How to find objects that have only one tag, e.g. [shop=supermarket] without any other tags?

  2. How to add a border of a city/county/province to an ordinary overpass query? I’d like to see nodes within a line which is a border of some region.

  3. Is it possible to find and list relations with overpass turbo which are not visualizable on the map (like type=master_route)?

  4. How to find with overpass turbo all nodes with “amenity” that are not members of any relation?

  5. I would like to write a query that will find all the street segments and its all addresses. Is it possible to set a variable so I will have to change the name of the street only in one place?

nw[highway]name=“Street Name”;
nw"addr:street"=“Street Name”;

So instead of changing “Street Name” in many places, I’d like to have a query like this:
variable=“Street Name”
nw[highway]name=variable;
nw"addr:street"=varibale;

  1. https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Nodes_with_exactly_one_specific_tag

  2. Not exactly clear what you mean, in any case you need to add an area: https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Count_number_of_addr:housenumber_in_an_area

  3. If you have a list of relevant tags, just use them in your query: rel[type=master_route]; out tags;

  4. Similar to https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Find_all_bus_stops_which_are_not_included_in_a_relation, and maybe https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Bus_relations,_which_are_not_part_of_a_master_relation

  5. See https://wiki.openstreetmap.org/wiki/Overpass_turbo/Extended_Overpass_Turbo_Queries - Section “Custom Shortcuts”

Just to add the city border in such a query for decorative purposes. I’ve already seen it somewhere.

It doesn’t work. It shows no data:

[out:json][timeout:250];
{{geocodeArea:Berlin}}->.searchArea;
(
  relation[type=route_master](area.searchArea);
);
out tags;

Tricky question. Can you check if this answers your question: https://help.openstreetmap.org/questions/50752/how-do-i-get-route_master-and-its-children-via-overpass-ql-in-overpass-turbo

Hmm, strange. The query

[out:json];
relation["type"="route_master"]["route_master"="bus"][network="NVV"];
(rel(r)({{bbox}});>;);
out meta;

works, but when I change the network to a different one, it doesn’t.

Can you post an example maybe, which didn’t work as expected?

I changed only “NVV” to “Wrocław”:

[out:json];
relation["type"="route_master"][network="Wrocław"];
(rel(r)({{bbox}});>;);
out meta;

which is the name of the netowork in my city, example:
https://www.openstreetmap.org/relation/2395313

Ah, I think the issue is that you didn’t point your map in overpass turbo to Wrocław before running the query. {{bbox}}) would only show any results, in they are in the current map’s bounding box.

You can get away with that restriction, and remove {{bbox}}. Then it doesn’t matter where your map is, you always will get some result.


[out:json];
relation["type"="route_master"][network="Wrocław"];
(rel(r);>;);
out meta;

Yes, this query returns some data.

But it’s not useful because it returns a lot of nodes and ways that I don’t need and doesn’t list any of route_master relations…

Sorry, can you describe again, what you’re trying to achieve? What data do you provide as input, what do you expect to get out?

Just to list the relations [type=route_master] with given [network=]. Because such relations are not visualisable on the map, I need a list.
I can find such relations using this tool, but I would like to do it with overpass turbo.