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
2.7k646
accept rate: 26%

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:

×73

question asked: 14 Mar '17, 07:32

question was seen: 1,524 times

last updated: 14 Mar '17, 09:23

powered by OSQA