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

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

For, this request The Response contains neigbourhood,suburb etc,.

For,this request 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?

asked 14 Mar '17, 07:32

Coder123's gravatar image

Coder123
16335
accept rate: 0%

edited 14 Mar '17, 07:33


The format of the response is the same. For the US address different address components are found than for the Indian address, e.g. for India there's also a state_district.

https://github.com/OpenCageData/address-formatting/blob/master/conf/components.yaml contains a list of possible common components. Anything not in that list, e.g. place_of_worship can usually be seen as the name of the place.

The maximum zoom level you can set is 18, that's also the default. Setting it to 27 has no effect.

Using &format=jsonv2 will add a couple of fields in the response. Maybe they're useful for what you're trying to do.

OSM_TYPE cannot be set in the request (gets ignored). Instead if you always just want roads then you can set the zoom parameter to a lower value like 16..

permanent link

answered 14 Mar '17, 09:02

mtmail's gravatar image

mtmail
4.8k1574
accept rate: 27%

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:

×85

question asked: 14 Mar '17, 07:32

question was seen: 3,151 times

last updated: 14 Mar '17, 09:23

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