Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does bbox-query return ways that are partially in the bounding box?

Tags:

overpass-api

I'm trying to figure out if Overpass-API's bbox-query should be returning ways that:

  1. Are entirely enclosed by the box (all nodes are inside the box)
  2. Have at least one node inside the box.
  3. At least one segment intersects with the box (even if no nodes are actually inside it).

The docs suggest that it should do #3. http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide#Bounding_box_clauses_.28.22bbox_query.22.2C_.22bounding_box_filter.22.29

A way is found not only if it has a node inside the bounding box but also if it just crosses somewhere the bounding box.

But, in practice I'm seeing that it's basically only #1. Which is much less useful as that makes it difficult to make sure you've got all the ways which affect your bounding box.

like image 268
O'Rooney Avatar asked Dec 21 '25 17:12

O'Rooney


1 Answers

I think I misunderstood. It does seem to return the ways that only intersect, ie #3, even if they have no nodes in the box. But I was confused because in my query I was also getting nodes and doing a union. It doesn't get the nodes for the way so Overpass-Turbo UI can't render the way. By recursing down, it gets the nodes as well and shows what I expect.

I was further confused because I was doing a query for relations as well, which finds many intersecting relations.

For example

<osm-script output="xml" timeout="25"><!-- fixed by auto repair -->
 <!-- gather results -->
 <union>
  <query type="way">
   <bbox-query w="-79.39941" s="43.64019" e="-79.39798" n="43.64120"/>
  </query>
  <query type="node">
   <bbox-query w="-79.39941" s="43.64019" e="-79.39798" n="43.64120"/>
  </query>
 </union>
 <union>
  <item/>
  <recurse type="down"/>
 </union>
 <!-- print results -->
 <print mode="meta" order="quadtile"/>
</osm-script>
like image 159
O'Rooney Avatar answered Dec 24 '25 08:12

O'Rooney



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!