1

I have a superroute in OpenStreetMap which defines a network of mountain bike trails (12425503) and it contains member routes such as (8467869).

I'm trying to write an Overpass QL query for the superroute, which returns the member routes, relations, etc.

How do I write a query to do this?

This query successfully returns 8467869:

(
  relation["type"="route"]["ref"="EPIC"](46.458673519829,-87.67682075500488,46.52975664934808,-87.58721351623535);
);
way(r);
(._;>>;);
out body;

But this returns nothing:

(
  relation["type"="superroute"]["ref"="RAMBA"](46.458673519829,-87.67682075500488,46.52975664934808,-87.58721351623535);
);
way(r);
(._;>>;);
out body;

2 Answers 2

0

That's a known limitation, see https://github.com/drolbr/Overpass-API/issues/293

You can only query for those superroutes without the bounding box filter as described here: https://help.openstreetmap.org/questions/50752/how-do-i-get-route_master-and-its-children-via-overpass-ql-in-overpass-turbo

As a side note: please note that the use of relations (in this case the superroute) as categories is not recommended and in fact discouraged, see https://wiki.openstreetmap.org/wiki/Relations_are_not_categories

3
  • Thanks for that info. I found that bug as well, in the linked thread. The wiki post you link to actually calls out what this relation is used for as a good use: aggregating cycling routes. In this case it's an superroute aggregating a number of other local cycling routes under the parent network. Commented Aug 27, 2021 at 20:05
  • Typically you would add a tag like "operator=RAMBA" and maybe "operator:website" to each single relation and remove the superroute. It's really not needed.
    – mmd
    Commented Aug 27, 2021 at 20:14
  • There are a number of places where one trail advocacy organization (in some cases this may be the operator, in others it wouldn't) spans multiple parks across a relatively wide geographical region. And each of those parks contains multiple trails, each trail which would be its own relation. I think it makes sense to have a superroute to aggregate all the trails within a given park, otherwise there's no unique identifier for the trail network within that park. Querying on everything for that operator would be too broad. Commented Aug 29, 2021 at 1:53
0

Found the answer thanks to this.

Turns out that superroutes don't have geometry of their own. So expanding the query, then setting a bbox for the child relations, does the trick:

(
  rel["type"="superroute"]["ref"="RAMBA"];
);
(rel(r)({{bbox}});>;);
out body;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.