I have a multi-language web site. On the web site, users can search products and services by geographic areas.
I am asking which is best approach to performs search of geographic areas. In this moment I am using geographic coordinates.
I stored in my database the boundaries of different areas, then when user input a city (for example) on the web site, I make a request to Google, I obtain coordinates, then I search if the coordinates retrieved by Google are within the boundaries I previously loaded on database.
This approach has some pros but also different cons.
PRO
- I do not care about language. Users input cities. I call google. Google give me coordinates. Then I make the search on coordinates;
CONS
- I must search boundaries of the regions e then store it on my database. Not always it is easy find free or detailed boundaries;
- Often different users input same cities more and more times. This means I call repeatedly Google to obtain alwais the same coordiantes. Google has a cost I cannot effort in this moment. But I found it is the most accurate service.
What I would like is remove dependencies from google.
I think I should store the cities, provinces, regions and countries all over the world in my database. Then make searches on the name. But name can change according to language (for example Paris, Parigi, Paryz, Parizh... ). So perhaps that is not the most correct way to performs research.
I am not looking for a solution language-based. But it is purely theory. What do you suggest?
Thank you