Find addresses in a given radius

I have a requirement to find all addresses within a given radius. I followed the steps to do this.

Google Places API

This only gives business addresses in radius. And it takes a radius as a parameter. https://maps.googleapis.com/maps/api/place/textsearch/json?key=myAPIKey&location=6.914701,79.973085&radius=100& sensor = false & gl = ep & request = *

Google Geodetic Reverse Geocoding

It just converts lat and lng data to addresses. It really does not meet my requirement. And it does not accept radius as a parameter. http://maps.googleapis.com/maps/api/geocode/json?latlng=6.914701,79.973085&sensor=false

Is there a way to get all addresses within a given radius. Specially resident addresses.

+4
source share
2 answers

Have you considered using OpenStreetMap for your task? Using the transition API, you can request all the data in a given bounding box . For example, this query returns all addresses that have a house number in the specified area. It uses overpass turbo for visualization and the Overpass API only in the background, but of course, you can also use the Overpass API to return raw data as XML or JSON.

However, due to the fact that your area has only slightly displayed house numbers in OSM, there are not many results. Other better displayed areas will work better, but you can try to improve your area if you want.

For more information on how to modify this query, see the commonly used tags and the Overpass API Language Guide .

+8
source

You can use the google map api command, for example, you can use the interval of points, for example, every 8 ° degrees in a certain radius and evaluate the json response from the Google map geocoding API. But the Google geocoding API does not support the same function as the APIs due to good privacy considerations. Read here about a similar question: A map of all points below a specific trip time .

+1
source

Source: https://habr.com/ru/post/1501230/


All Articles