OpenStreetMap

Searching relations

Posted by pangoSE on 11 September 2018 in English (English)

Nominatim does NOT search route relations. I use taginfo & overpass.

The downside of overpass is that it:

  • does not use wildcards by default using the wizard
  • does not search case-insensitive by default using the wizard

Example of searching for the route Härnö Trail in Härnön: https://taginfo.openstreetmap.org/search?q=h%C3%A4rn%C3%B6+trail#values -> click the orange -> click overpass symbol -> from overpass you can click the map object and -> click to osm.org from there

Alternatively you can download Härnön in JOSM and search for the relation there. (much easier if you know where it is beforehand)

iD does not yet show relations, only memberhip of relations on objects. Also iD lacks a way to check that your edit did not break (the continuity of) one or more relations.

(edited to remove the incorrect assumption that it does not accept wildcards and to specifically mention route relations)

Comment from TomH on 11 September 2018 at 11:12

It is completely untrue that Nominatim doesn't search relations - the first result for https://nominatim.openstreetmap.org/search.php?q=Broxbourne is https://nominatim.openstreetmap.org/details.php?place_id=198582074 which is, as the page clearly says, a result for https://www.openstreetmap.org/relation/2677978.

Comment from ikonor on 11 September 2018 at 13:21

Waymarked Trails can search for route relations: https://hiking.waymarkedtrails.org/#search?query=H%C3%A4rn%C3%B6

Comment from mmd on 11 September 2018 at 14:30

overpass * does not search case-insensitive

That's also incorrect. Please check out the documentation first next time before posting.

Comment from SomeoneElse on 13 September 2018 at 15:18

I'm not sure why everyone seems to be shooting the messenger here :)

Whilst it's true that that Nominatim can be used to search for relations (in fact most of the time I search for places in OSM I'll be returned a relation) it's also true that relations of the type that the author was looking for here won't be returned by Nominatim (which is fair enough - it's designed as a place search engine, not a hiking trail search).

Also, Overpass' wildcard support seems to have been written by Incy Wincy Spider, and using Nominatim to create Overpass queries for you is definitely far easier than trying to remember Overpass' syntax without crib notes - it's how I always do searches like this.

All in all I'm sure that this diary entry will be useful to lots of people - I'm not sure why there's all the negativity.

Comment from mmd on 13 September 2018 at 15:28

Case insensitive wildcard search for a relation name isn't really that difficult:

rel["name"~"härnö trail",i];
out geom;

Comment from pangoSE on 13 September 2018 at 20:41

@TomH thanks for the example. I was referring to relations of the type route. See https://github.com/openstreetmap/Nominatim/issues/413

@mmd Thanks for the tip about case insensitive search. I did not look it up, but referred to the default when using the wizard on https://overpass-turbo.eu/ (the wizard could definitely be improved with a checkbox for case-insensitive search ticked by default)

Looking for the issue referenced above I found http://ra.osmsurround.org/searchRelation, but unfortunately it lacks information about how recent a snapshot its search is running on and fails to find the relation in question which I added a couple of weeks ago: http://ra.osmsurround.org/searchRelation?name=h%C3%A4rn%C3%B6&relationType=route&route=&ref=&network=&operator=

Comment from pangoSE on 13 September 2018 at 20:43

@ikonor thanks for the tip. I recently changed the route from =running to =hiking;running so now it shows up on waymarked trails as well. I contacted the author of waymarked trails to enquire about the possibility of adding a "running" subsite and she was positive about that. :)

Comment from Nodililpa on 17 September 2018 at 16:54

"Thanks for good work

Login to leave a comment