Hi - I want to use Nominatim's reverse geocoder to get a lat/lon for this node: 269908858 (Mérida, Yucatán, Mexico) Here's the node on OSM:
The node has lat/lon data according the XML provided by OSM API:
However, when I pass it to Nominatim it returns an error:
(the code format tag on this board is subbing "&" for " Error message:
What's missing from this node that causes this error, and what can I do about it? Thanks loads for the help! asked 21 Feb '18, 10:37 case_the_joint |
I think you want to use the /lookup method since you're not supplying a lat,lon in the search. https://nominatim.openstreetmap.org/lookup?osm_ids=R6265959&format=json When you do a forward search https://nominatim.openstreetmap.org/search?q=M%C3%A9rida&countrycodes=mx you'll note that Nominatim uses the city relation (https://www.openstreetmap.org/relation/5961522), not the city node (https://www.openstreetmap.org/node/269908858).
Nothing. The relation has a answered 21 Feb '18, 11:06 mtmail 1
Hi @mtmail thanks so much for the quick response and advice. I forget why I used the reverse and not the lookup. For completeness' sake, the lookup has a slightly different syntax than you suggest:
So if I wanted to get a set of coordinates for the
(21 Feb '18, 11:28)
case_the_joint
1
You're right, thanks, I updated the URL in my answer. For a relation result Nominatim tries to use the linked admin_center or admin_label roles (nodes) to set the center. So it knows about those nodes just merges the information. For example for "Hamburg" (the state, https://www.openstreetmap.org/relation/62782) which is split into two parts it returns the center point of the admin_center not the geographic center https://nominatim.openstreetmap.org/lookup.php?osm_ids=R62782 because that wouldn't even be inside the relation/multi-polygon.
(21 Feb '18, 13:37)
mtmail
Thanks for the clarification! You've been very helpful, thank you.
(21 Feb '18, 15:58)
case_the_joint
|