Is it possible to get all OSM nodes (are not belong to any way) using the Overpass API?

StackOverflow https://stackoverflow.com/questions/18885214

  •  29-06-2022
  •  | 
  •  

Frage

I want to get all OSM nodes (are not belong to any way).
Is it possible?

Understandably, this query get all nodes (includes member of ways)...

<osm-script output="json">
    <query type="node">
      <bbox-query {{bbox}}/>
    </query>
    <print/>
</osm-script>

Update 19 Sep 20:20(GMT+9:00)

I tried tyr's query and success!

enter image description here

War es hilfreich?

Lösung

Actually, this is possible since the latest version of Overpass API:

<osm-script output="json">
  <query type="way">
    <bbox-query {{bbox}}/>
  </query>
  <recurse type="way-node" into="waynodes"/>
  <query type="node" into="allnodes">
    <bbox-query {{bbox}}/>
  </query>
  <difference>
    <item set="allnodes"/>
    <item set="waynodes"/>
  </difference>
  <print/>
</osm-script>

http://overpass-turbo.eu/s/14F

This uses the difference operator to subtract nodes that are member of any ways from all of the nodes.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top