Why not ask your question on the new OpenStreetMap Community Forum?

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 "&" so correct this manually before opening)

Error message:

Output:{"error":"Unable to geocode"}

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's gravatar image

accept rate: 0%

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).

What's missing from this node

Nothing. The relation has a Node Mérida (269908858) as admin_centre set. For Nominatim that means both describe the same place. Nominatim chooses to ignore the node in this case.

permanent link

answered 21 Feb '18, 11:06

mtmail's gravatar image

accept rate: 27%

edited 21 Feb '18, 13:27


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 Merida node itself, and Nominatim won't return that, then is the best substitute I can get from OSM the centre point of the Merida relation (5961522)?

(21 Feb '18, 11:28) case_the_joint

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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 21 Feb '18, 10:37

question was seen: 4,755 times

last updated: 21 Feb '18, 15:58

powered by OSQA