Find addresses within given radius
Asked Answered
E

2

7

I have a requirement to find all the addresses within given radius. I have implemented following to get done this.

Google Places API

This only provide business addresses within the radius.And it accept radius as a parameter. https://maps.googleapis.com/maps/api/place/textsearch/json?key=myAPIKey&location=6.914701,79.973085&radius=100&sensor=false&hl=en&query=*

Google reverse geocoding

It's just converting given lat & lng to addresses. This doesn't actually meet my requirement.And it is not accepting radius as a parameter. http://maps.googleapis.com/maps/api/geocode/json?latlng=6.914701,79.973085&sensor=false

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

Emanate answered 9/9, 2013 at 2:22 Comment(5)
what do you think google maps is? a spam data feeder?Azygous
@Azygous I am not complaining about Google. I am asking possibilities of implementing such feature, there could be an API.Emanate
The potential for abuse and privacy violation is high on a such a API IMHOAzygous
Duplicate: #9404199Icily
@Phpdna I don't think the pointed out duplicated question has any relation to my question. Please check again.Emanate
E
16

Have you considered using OpenStreetMap for your task? With the help of the Overpass API you can query for all data within a given bounding box. For example this query returns all addresses which have a house number within your mentioned area. It uses the overpass turbo for visualization and the Overpass API only in the background but of course you can also use the Overpass API directly for returning raw data as XML or JSON.

However because your area has only sparsely mapped house numbers in OSM, there isn't much to return yet. Other better mapped areas will work way better but you can try to improve your area if you want.

For more information about how to modify the given query take a look at commonly used tags and the Overpass API language guide.

Electrotherapeutics answered 11/9, 2013 at 20:20 Comment(1)
Appreciate your answer. But it looks like OpenStreetMap doesn't have location details than Google for my country. It may have covered main countries. However your answer helped me. FOr the moment I ahave developed combination of Google Places API and reverse geocoding.Emanate
I
3

You can brute force the google map api for example you can use an interval of points for example every 8° degree within a certain radius and evaluate the json response from the Google maps geocode API. But the Google map geocode API doesn't support the same feature like the places API because of good privacy reasons. Read here about a similar question: Map of all points below a certain time of travel?.

Icily answered 11/9, 2013 at 20:37 Comment(7)
Maybe you can explain me a) op thinks this doesn't solve his answer b) similarities to your answer?Icily
Sorry, I don't understand your questions. Can you rephrase them? I'm just curious if brute forcing their API is allowed by their terms of service. This hasn't anything to do with my answer.Electrotherapeutics
The api says it allows X request per day. What's your problem?Icily
My answer has nothing to do with your anwser? Or do you mean Google Api doesn't allow X requests per day?Icily
Again, I just wanted to know if such bulk queries are allowed. If they are then everything is fine.Electrotherapeutics
I think it's nothing wrong if you don't exceed a certain limit :). But I have asked you a question you didn't understand? You can read about OP's comments and you get 2 upvote for your question? Why? OP says in a comment my answer has nothing to do with it? Why? Or is your comment just a fun comment? I think it's serious issue (and I don't mean GOOGLES terms of service)?Icily
I'm not quite sure what you are trying to tell or ask me. None of my comments or answers are meant as fun.Electrotherapeutics

© 2022 - 2024 — McMap. All rights reserved.