1

I am trying to do reverse geocoding using open street maps. I am getting 2 different Json formats in the response.

For, http://nominatim.openstreetmap.org/reverse?json_callback=cb&format=json&lat=12.975360&lon=80.190122&zoom=27&addressdetails=1 The Response contains neigbourhood,suburb etc,.

For,http://nominatim.openstreetmap.org/reverse?json_callback=cb&format=json&lat=40.119198&lon=-75.355764&zoom=27&osm_type=N&addressdetails=1 The Response contains county and other fields.

I do see that the OSM_TYPE is differing in both the response(node/way). Is there any way to restrict the type of response?I tried to add OSM_TYPE in the query string which doesn't seem to work. Is there anyother format that could be received?

  • The different fields in the response have nothing to do with the osm_type. Different parts in the world have different levels of detail in OSM (and other geocoders). – scai Mar 13 '17 at 11:56
  • cross-posted: stackoverflow.com/q/42736283/1340631 – scai Mar 13 '17 at 12:21
  • @scai - what is the best way to handle the data if different fields are in the response? Is there any documentation for various levels of detail sent back by OSM? – coder231 Mar 13 '17 at 12:37
  • According to the Nominatim documentation the hierarchy should correspond to the admin_level tag of boundary=administrative relations. The admin level values have different meanings depending on the country. – scai Mar 13 '17 at 12:56
  • cross-posted: help.openstreetmap.org/questions/55051/… – scai Mar 14 '17 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.