Why not ask your question on the new OpenStreetMap Community Forum?


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.

      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;

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 '17, 10:50

CillaLu's gravatar image

accept rate: 0%

edited 14 Mar '17, 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);
way['amenity' = 'bar'](44.943, 7.504, 45.174, 7.887);
out geom;
permanent link

answered 14 Mar '17, 17:27

maxerickson's gravatar image

accept rate: 32%

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

(18 Mar '17, 15:28) CillaLu

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

permanent link

answered 14 Mar '17, 12:29

Hjart's gravatar image

accept rate: 18%

Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 14 Mar '17, 10:50

question was seen: 2,365 times

last updated: 18 Mar '17, 15:28

powered by OSQA