0
1

I need to perform a query that collects all the nodes and ways that contain a specific tag. I also need, however, to get all the member nodes of the resulting ways even if they do not contain the specified tag. Finally, I need to sort the result in order to have: first the list of all nodes and then the list of the ways, removing all duplicates. I did this, but it doesn't work properly.

 [out:json];
    (
      node['amenity' = 'bar'](44.943, 7.504, 45.174, 7.887) -> .nodes;
      way['amenity' = 'bar'](44.943, 7.504, 45.174, 7.887) -> .ways;
      node(w) -> .nodesMembersWays;
    );
    (
    .nodes;
    .nodesMembersWays;
    .ways;
    );
    out;

Or, if there is a method to directly download the ways with the coordinates of their member nodes, that would be the top.

asked 14 Mar, 10:50

CillaLu's gravatar image

CillaLu
31225
accept rate: 0%

edited 14 Mar, 11:41


You can do this by using more than one print statement and geom output for the ways:

node['amenity' = 'bar'](44.943, 7.504, 45.174, 7.887);
out;
way['amenity' = 'bar'](44.943, 7.504, 45.174, 7.887);
out geom;
permanent link

answered 14 Mar, 17:27

maxerickson's gravatar image

maxerickson
6.5k74795
accept rate: 29%

Thank you so much, this is exactly what i was looking for.

(18 Mar, 15:28) CillaLu

In the Wizard of Overpass-turbo try inserting amenity=bar & (type:way | type:node)

permanent link

answered 14 Mar, 12:29

Hjart's gravatar image

Hjart
89711018
accept rate: 10%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×85
×31

question asked: 14 Mar, 10:50

question was seen: 377 times

last updated: 18 Mar, 15:28

powered by OSQA