Converting latitude/longitude into city name? (reverse geolocating)

后端 未结 6 1757
礼貌的吻别
礼貌的吻别 2020-12-23 15:11

I\'m working on a job board in Codeigniter PHP + jQuery where employers enter their location and we use Google Maps API to plot it. While this has had awesome usability res

6条回答
  •  时光说笑
    2020-12-23 16:10

    Reverse geocoding services (such as Google, Yahoo, and GeoNames) will work well for this purpose with a few caveats:

    • Although I can't say for sure how the commercial services work, last time I checked GeoNames uses a closest point of interest strategy to determine the city. This can be a problem if your query point is somewhat near a border between two cities and the nearest entry in the GeoNames database is on the other side of that border. This actually happens a fair bit in my experience, so this is not just some technicality.
    • Also, if you are concerned about user experience, any web API solution adds latency and reduces reliability.

    I run a web site that offers a number of commercial geographic web APIs, and sells the Java libraries that we built to back those APIs. One of them (which only has US coverage) uses a proper polygonal map of the cities and towns in the US to return the result that contains your query point. It is accurate and fast, so if this is a mission critical component in your system, I suggest taking a look at our web site:

    http://askgeo.com

    The page that is specific to looking up cities from lat/lon is:

    http://askgeo.com/database/UsPlace2010

提交回复
热议问题