I'm using Overpass QL to retrieve data for a bounding box (about 2 km square). I'd like to get:

  • all the nodes, ways, and rels within the box
  • all the ways and rels that reference these items
  • nearby nodes on included ways, for rendering

Currently, my request looks like this:

  [bbox:...];
  ( node; way; rel; );
  ( ._; <<; ); out;

This mostly works, but it doesn't give me nearby nodes on included ways, if the nodes are outside the box. So, for example, I can't draw the path the freeway takes heading out of the box. I'm afraid to use the >> operator, however, lest I get inundated by data (eg, every node on Interstate 10 :-). I could make my bounding box larger and clip the results, but that seems wasteful.

Comments, clues, suggestions?

-r

asked 16 Dec '17, 00:55

Rich_Morin's gravatar image

Rich_Morin
11112
accept rate: 0%


As a workaround, I'm currently using a pair of bounding boxes, as follows:

  • Use the "real" bounding box (b1) to get nodes, rels, and ways.
  • Recurse upward to get referencing rels and ways.
  • Fold in nodes from a slightly larger bounding box (b2).

Making b2 20% wider and taller than b1 produces clean results, at the cost of downloading about 30% more data. Currently, my request looks something like this:

( node(b1); way(b1); rel(b1); );
( ._; <<; node(b2); ); out;

Still hoping for a cleaner solution...

-r

permanent link

answered 16 Dec '17, 04:49

Rich_Morin's gravatar image

Rich_Morin
11112
accept rate: 0%

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:

×49
×11
×3

question asked: 16 Dec '17, 00:55

question was seen: 960 times

last updated: 16 Dec '17, 04:49

powered by OSQA