简体   繁体   中英

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

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!

在此处输入图片说明

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM