NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

3
1

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 '17, 09:53

andrewblack's gravatar image

andrewblack
3651214
accept rate: 57%

edited 30 Jun '17, 10:25

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

(30 Jun '17, 12:43) andrewblack

I have an answer to this. Will write up tomorrow

(30 Jun '17, 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 '17, 19:47

Nakaner's gravatar image

Nakaner
610813
accept rate: 16%

1

Wow, that is a life saver! Here's how I finally got just the slice of the border of Paraguay that I needed:

relation(389884)->.interestingrelations;

way(r.interestingrelations)->.alltheirways;

way.alltheirways(-25.2,-59.5,-24.2,-58)->.waysinside;

.waysinside out geom;

(12 Oct '20, 08:29) jidanni
1

FYI: http://overpass-turbo.eu/s/Z1J relation(389884); way(r)(-25.2,-59.5,-24.2,-58); out geom;

(14 Oct '20, 19:49) DaveF

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:

×483
×228

question asked: 30 Jun '17, 09:53

question was seen: 3,470 times

last updated: 14 Oct '20, 19:49

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum