Searching relations
Do pangoSE đăng vào 11 tháng 09 năm 2018 bằng English. Cập nhật lần cuối cùng vào 15 tháng 09 năm 2018.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)
Thảo luận
Bình luận của TomH vào 11 tháng 9 năm 2018 lúc 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.
Bình luận của SK53 vào 11 tháng 9 năm 2018 lúc 13:01
Equally untrue that Overpass does not allow wildcards: https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Key.2Fvalue_matches_regular_expression_.28.7E.22key_regex.22.7E.22value_regex.22.29
Bình luận của ikonor vào 11 tháng 9 năm 2018 lúc 13:21
Waymarked Trails can search for route relations: https://hiking.waymarkedtrails.org/#search?query=H%C3%A4rn%C3%B6
Bình luận của mmd vào 11 tháng 9 năm 2018 lúc 14:30
That’s also incorrect. Please check out the documentation first next time before posting.
Bình luận của SomeoneElse vào 13 tháng 9 năm 2018 lúc 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.
Bình luận của mmd vào 13 tháng 9 năm 2018 lúc 15:28
Case insensitive wildcard search for a relation name isn’t really that difficult:
Bình luận của pangoSE vào 13 tháng 9 năm 2018 lúc 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=
Bình luận của pangoSE vào 13 tháng 9 năm 2018 lúc 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. :)