3

I would like to know the reason the below posted code shows ways and nodes? As shown below, I want to visualise only the relations but when I run the code on overpass turbo, it shows ways and nodes?

Code:

area["ISO3166-1"="DE"][admin_level=2]->.germany;
area["addr:city" = "Potsdam"](area.germany)->.potsdam;
(
   //node["sport" = "climbing"](area.germany);  
   //way["sport" = "climbing"](area.germany);  
   relation["amenity" = "university"]["addr:postcode"="14469"](area.potsdam);  
)->.s;

out geom qt;
1
  • It depends of what you mean. With Overpass Turbo, you get the relation and associated data (ways and nodes) in tab "data" due to feedback from Overpass API (used by Overpass Turbo front-end). If you go to the relation itself in OSM API, you will get only the relation and references to its nodes and ways e.g openstreetmap.org/api/0.6/relation/9330942
    – ThomasG77
    Commented Mar 7, 2021 at 13:19

1 Answer 1

5

Unfortunately, it's not clear from your description what you mean by "visualise only the relations". Relations are made up of ways and nodes, and ways are made up of nodes. Relations don't have any geometry on their own, hence you wouldn't have anything to draw on a map.

In case you want to see the perimeter of that relation (the member with role "perimeter"), you can use:

area["ISO3166-1"="DE"][admin_level=2]->.germany;
area["addr:city" = "Potsdam"]->.potsdam;

(
  relation["amenity" = "university"]["addr:postcode"="14469"](area.germany)(area.potsdam);  
  way(r:"perimeter");
  node(w);
);
out qt;

Note that your query also used a non-supported "area in area" style query, which is not supported (area["addr:city" = "Potsdam"](area.germany)->.potsdam;). I fixed this part in my query as well.

7
  • truly appreciate your answer. 1.i would like to learn more about roled as the one you used which is "premiter". what roles also exists. 2.why (area.germany) in line number 2 is omitted in your answer?i used it as input set on which or within which the search for Potsdam will be executed.
    – Amrmsmb
    Commented Mar 7, 2021 at 13:33
  • by visualize i ment , to show on the map in overpass turbo
    – Amrmsmb
    Commented Mar 7, 2021 at 13:34
  • (area.germany) is not omitted, it is included in the relation query as (area.germany)(area.potsdam) - so this will act on both areas at the same time. This Q&A site is not a good place to discuss OSM tagging. I'd suggest to refer to some OSM forum instead.
    – mmd
    Commented Mar 7, 2021 at 13:36
  • is the parameter "perimeter"you mentioned is in the api?what other values "role" can have?
    – Amrmsmb
    Commented Mar 7, 2021 at 16:11
  • 1
    No, "perimeter" is a so called relation member role and comes from some mapper defining that value in OSM. You can see it in openstreetmap.org/api/0.6/relation/9330942 as <member type="way" ref="619437369" role="perimeter"/> - you need to dig into the OSM tagging to learn more about it. That however would be outside the scope of this question.
    – mmd
    Commented Mar 7, 2021 at 16:19

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.