Search code examples
androidsqlgoogle-mapsgoogle-geocodergoogle-geocoding-api

Proximity search based on Latitude and Longitude


I am making a market type application, in which users enter product details and product address, now I Geocode this address into latitude and longitude using Google Geodcoder and further I process this information into MySql Database. The proximity search is working flawless if I provide a user defined radius for searching in the vicinity. However I am not able to determine as to how will I handle it at the border of a country. I dont want people from India to be able to view a product from Pakistan, this will prove a disaster for my application as both are at war. Any Suggestions as to how can I overcome this.

I had some other suggestions too at: https://dba.stackexchange.com/questions/39115/zip-based-search-in-mysql/39138?noredirect=1#comment69710_39138

However I want the best and the most efficient way of doing this. Any help would be highly appreciated.


Solution

  • You can check the following PDF and for restriction of countries, I think you can restrict the search to a country by including the Where Country = 'XCountry' in your search query.

    http://www.arubin.org/files/geo_search.pdf