I am trying to download all roads for a specific area rel:2800276, including those exactly on the boundary of the area (e.g. way:171480859). However, the query seems slow if I add a few commands (Line 3-4) specifically ask for proximity to the boundary of area like this:

[out:json][timeout:3600][maxsize:1073741824];
area(3602800276)->.t;
rel(pivot.area.t);
way["highway"](around:0.0);
(._;way["highway"](area.t););
(._;>;);
out;

Should I use some other methods to include the roads exactly on the boundary? It looks like by default the area filter just report features with at least one point properly within the area.

** For simplicity, all ways with highway tag are assumed to be roads here.

asked 07 Oct, 07:58

yikhim's gravatar image

yikhim
1112
accept rate: 0%


I hope I'm proved incorrect, but I don't think there's a simple way to perform this. To me the is_in command should be able to perform this.

First, the reason your routine is slow is way["highway"](around:0.0); is searching the whole globe for all for highway. It needs to be passed the desired area to search. Your next line is superfluous as it's duplicating the previous.

This routine: The first 'out' is, hopefully, all ways touching the relati9on. Second is all ways within the relation. Third is the relation itself.

rel(2800276)->.Kwun;
way(around.Kwun:0)[highway=secondary];
out geom;

.Kwun;map_to_area;
way(area)[highway=secondary];
out geom;

.Kwun out geom;

General Point: you may want to check if the boundary does actually go down the centreline of the road. They rarely do.

permanent link

answered 07 Oct, 18:55

DaveF's gravatar image

DaveF
3.1k7894127
accept rate: 15%

edited 07 Oct, 19:08

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:

×467

question asked: 07 Oct, 07:58

question was seen: 280 times

last updated: 07 Oct, 19:08

powered by OSQA