NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi,

Got a location(lat&lon) from a geocode response. Then tried to reverse geocoding with that location(exact lat & lon), But got some other data with different lat & lon in response.

For Eg: http://nominatim.openstreetmap.org/search?format=json&polygon_geojson=1&q=vellore,%20tamilnadu

Get lat & lon of 1st data(lat=12.9071753&lon=79.1309695).

http://nominatim.openstreetmap.org/reverse?format=xml&lat=12.9071753&lon=79.1309695&addressdetails=1

Check reverse geocoding response, expect the same data(which got in geocoding), but getting different data.

asked 03 Jan '18, 10:27

Rajavelu_M's gravatar image

Rajavelu_M
253454858
accept rate: 33%

edited 03 Jan '18, 10:58

Maybe the reverse geocoding tries to search for the nearest POI. The geocoding query returns the city node because that's what you've been searching for. The reverse geocoding query instead returns a school node which I consider to be more relevant than a somewhat arbitrarily placed city node. Could be just a coincidence, though.

(03 Jan '18, 11:21) scai ♦

reverse and search are not inverse operations of each other. They use the same database and produce a similar looking output format but that is all. They use completely different algorithms to compute the respective results.

In the particular example search returns the centre coordinates for the town you are looking for and reverse then returns the closest object to that centre. It tries to be as precise as possible, so preferably returns a street or address with house number or a POI like, as in this case, a school building. Your original town is still contained in the response in the address part. So the result is not wrong, just more precise than you expected.

permanent link

answered 03 Jan '18, 11:37

lonvia's gravatar image

lonvia
6.2k25789
accept rate: 40%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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:

×710
×689
×230
×133
×85

question asked: 03 Jan '18, 10:27

question was seen: 2,745 times

last updated: 03 Jan '18, 11:37

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum