OpenStreetMap 标志 OpenStreetMap

Searching relations

pangoSE 于 2018年九月11日 以 English 发布 最后一次更新于2018年九月15日。

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)

电子邮件图标 Bluesky图标 Facebook图标 LinkedIn图标 Mastodon图标 Telegram图标 X图标

讨论

TomH2018年09月11日 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 osm.org/relation/2677978.

ikonor2018年09月11日 13:21 的评论

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

mmd2018年09月11日 14:30 的评论

overpass * does not search case-insensitive

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

SomeoneElse2018年09月13日 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.

mmd2018年09月13日 15:28 的评论

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

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

pangoSE2018年09月13日 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=

pangoSE2018年09月13日 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. :)

登录以留下评论