I am trying to query on hiking routes http://overpass-turbo.eu/s/q52 using the following centred on London.

[out:json][timeout:25];
relation["route"="hiking"]({{bbox}});
out geom;

I am finding I getting data I don't want which has a performance impact. I think I have two issues.

  1. Some of the relations are very big. (3212473 Greenwich Meridian Trail 20469 Thames Path)
  2. I am getting relations that are way outside my viewport (Shakespeare's Way - 71448) and I can't see why.

On point 1., can I process the relation - eg only output the ways that appears in my viewport. If I am interested in London I dont want details of the route near lincoln.

asked 30 Jun, 09:53

andrewblack's gravatar image

andrewblack
41115
accept rate: 0%

edited 30 Jun, 10:25

Re Shakespeare's Way - something odd about the data. Investigating further

(30 Jun, 12:43) andrewblack

I have an answer to this. Will write up tomorrow

(30 Jun, 23:42) andrewblack

If you want all relations being tagged with route=hiking but only those ways of those relations which are inside your bounding box, you should try following query:

[out:json][timeout:25];
// Store all interesting relations which intersect with the bounding box in
// a set called "interestingrelations".
relation["route"="hiking"]({{bbox}})->.interestingrelations;
// Store all way members of the relations in the set "interestingrelations"
// in the set "alltheirways".
way(r.interestingrelations)->.alltheirways;
// Filter "alltheirways" using a bounding box filter. Store result in "waysinside".
way.alltheirways({{bbox}})->.waysinside;
// Output geometry of "waysinside".
.waysinside out geom;

Features of Overpass QL in use:

permanent link

answered 10 Jul, 19:47

Nakaner's gravatar image

Nakaner
38559
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:

×259
×64

question asked: 30 Jun, 09:53

question was seen: 343 times

last updated: 10 Jul, 19:47

powered by OSQA