what is the best geocode to get long and lot for a street address? [closed]

故事扮演 提交于 2019-12-24 01:37:26

问题


i have street addresses in the format of

1 Rue du Four, 60200 COMPIEGNE, France

2 Rue de Lancry, 60200 COMPIEGNE, France

And the list of address can be up to 100 000. hundred thousand.

currently i am using google gecode but it has limitations like per day 2500. i kept on getting this error.

google.maps.GeocoderStatus.OVER_QUERY_LIMIT

then i managed to do it with a timeout like below

function codeAddress(markersAddress) {

var address = markersAddress.address;
var name = markersAddress.name;
var info = markersAddress.info;
geocoder.geocode({'address': address}, function (results, status) {
  if (status == google.maps.GeocoderStatus.OK) {
    var latLng = results[0].geometry.location;
  } else {
    if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
      setTimeout(function() { codeAddress(markersAddress); }, (timeout * 3));
    } else {
      console.log('Geocode was not successful for the following reason: ' + status);
    }
  }
});

however this method is causing slowness in the browser when there is 100 000 records. so is there any better way to get geocode with a api ?


回答1:


Geocode the addresses off-line and "cache" the results (for less than 30 days to comply with the terms of service), use the coordinates to display your markers.

More details: Geocoding Strategies article in the Google Maps Documentation.



来源:https://stackoverflow.com/questions/34022948/what-is-the-best-geocode-to-get-long-and-lot-for-a-street-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!