How to convert an address to a latitude/longitude?

前端 未结 18 2876
难免孤独
难免孤独 2020-11-29 16:21

How would I go about converting an address or city to a latitude/longitude? Are there commercial outfits I can \"rent\" this service from? This would be used in a commercial

18条回答
  •  执念已碎
    2020-11-29 16:49

    Google has a geocoding API which seems to work pretty well for most of the locations that they have Google Maps data for.

    http://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html

    They provide online geocoding (via JavaScript):

    http://code.google.com/apis/maps/documentation/services.html#Geocoding

    Or backend geocoding (via an HTTP request):

    http://code.google.com/apis/maps/documentation/services.html#Geocoding_Direct

    The data is usually the same used by Google Maps itself. (note that there are some exceptions to this, such as the UK or Israel, where the data is from a different source and of slightly reduced quality)

提交回复
热议问题