什么是最好的地址码,以获得一个街道地址很长的地段? [英] what is the best geocode to get long and lot for a street address?
问题描述
我有街道地址,格式为
1 Rue du Four,60200 COMPIEGNE,France
2 Rue de Lancry,法国60200 COMPIEGNE
地址列表最多可达100 000美元。
目前我使用的是谷歌地理代码,但它有每天2500的限制。我不断收到此错误。
google.maps.GeocoderStatus.OVER_QUERY_LIMIT
然后我设法做到这一点,像下面的超时
函数codeAddress(markersAddress){/ b>
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不成功:'+ status';
}
}
});
然而,当有100 000条记录时,这种方法会导致浏览器速度变慢。所以有没有更好的方法来获取地理编码与api?
解决方案地理编码地址离线和缓存结果(少于30天才能符合服务条款),使用坐标显示您的标记。
更多详细信息: Geocoding Strategies 文章。
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 ?
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.
这篇关于什么是最好的地址码,以获得一个街道地址很长的地段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!