开发者

Geolocation & proximity - what services, APIs and resources can I use?

开发者 https://www.devze.com 2023-03-26 09:23 出处:网络
I have no experience of geolocation and what services/APIs are out there so I\'m asking for help. I want to be able to store geolocations that could be a street, city, province, country or continent.

I have no experience of geolocation and what services/APIs are out there so I'm asking for help.

I want to be able to store geolocations that could be a street, city, province, country or continent. And I want to be able to answer these q开发者_开发百科uestions:

  1. What is the distance between geolocation A to geolocation B?

  2. Is geolocation A contained by geolocation B? e.g. is Paris inside Europe?

If it was just a matter of geographical coordinates it would be simpler, but I want to compare proximity between geographical regions and see if one is contained by another. I imagine two ways of how this can be done:

  1. a database of hierarchical structure of country->province->city->street, each node having a geographical coordinate to find the distances and to find if one node containes another you do a tree search.
  2. represent cities, countries etc. as geographical shapes that you can see if they intersect and you can calculate the distance between.

In order to solve it either way I need to know either the geographical shape or the hierarchy of a given geolocation. So how can I get this information?

Thanks


Q1: Yahoo GeoPlanet is what you are looking for. They have this hierical mapping unlike google.

Q2: Google Geocoding API supplies you with bounds of an object. When you have fetched it from Yahoo you could get the bounds off Google. :D

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号