Forum Moderators: phranque

Message Too Old, No Replies

what's the best approach to geocoding?

zip codes, cities or something else?

         

nondual

2:04 pm on Jun 10, 2006 (gmt 0)

10+ Year Member



I'd like my users to be able to search for widgets within x miles of a given location. I understand that I'll need to convert the location (both the widget's location and the user's location) to geograhic co-ordinates and then use an algorithm to calculate the distance between the two. That much I don't have a problem with.

My issue is with the method used to get the location (either of the widget or the user). I've looked at several possibilities:

1. Use google maps, yahoo maps or another mapping API to allow users to specify their location on the map. I've decided against this because I don't know of any accessible mapping API.

2. Get the location as a zip code & country, then use a geocoding database to convert those to co-ordinates. I don't like this approach because geocoding zip codes is a bit hit and miss depending on the country. Some countries have extensive data available, others don't.

3. Get the location as a city & country. It has a similar problem to using zip codes, the searches are also not as accurate. A city can cover a wide area.

4. use a hierarchial listing of places, and allow the user to choose their location. e.g. US > Maine > Portland . I like this solution but I'd need a comprehensive list of world locations organised in such a hierarchy - I've not been able to find any yet. Any suggestions?

what solution are others using for proximity based searching?