1

I am querying objects with Overpass Turbo, which are restricted to a specific area.
I restrict the query via a relation, in this case a city boundary. Then I map them to the area to query via map_to_area

My problem is that the output always contains the relation itself, but I don't need it. It also is displayed on top of all nodes, so that I cannot see the nodes and ways in overpass turbo, but only the relation (see screenshot below).

Can I somehow suppress the relation in the output (both the map and the JSON)?

Here's my example. I would like to just have the nodes and ways.

[out:json][timeout:25];
(
  {{plz=40589}}
  rel[postal_code="{{plz}}"];
  map_to_area;
  node["power"="generator"]["generator:method"="photovoltaic"](area);
  way["power"="generator"]["generator:method"="photovoltaic"](area);
);
(._;>;);
out body;
out count;

Screenshot of Overpass Turbo's map view with a relation shown as area, which hides all nodes and ways which are also in the output. in the bottom right corner, it says "loaded Nodes: 424, ways: 24, relations: 1, areas 1"

1 Answer 1

2

Your query is doing an union of:

  1. elements with the relation linked to the postal code
  2. nodes with ["power"="generator"]["generator:method"="photovoltaic"]
  3. ways with ["power"="generator"]["generator:method"="photovoltaic"]

However, there are no nodes nor ways with those tags in the area. So they're not hidden, they're just not there.

To not have the 1. element above, you have to assign it to a set, and then search in that set: (I removed the generator part to have some nodes returned)

(
  {{plz=40589}}
  rel[postal_code="{{plz}}"];
  map_to_area;
      )->.a;   /relation to set .a

/now the union of the search in .a:
 (
  node["power"](area.a);
  way["power"](area.a);
);
(._;>;);
out body qt;

out count;

overpass query

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.