问题
Google Geocoding API has serious limitations (2,500 requests per day) and we always get a limit error. Their business license costs $10,000 and it is too expensive for us.
Service should work with different languages and different countries.
Service should verify address and return lat/lng. The addresses could be a strings with different formats.
We are ready to pay for such service and RESTful API is preferable.
回答1:
I worked at SmartyStreets and what you describe is their core domain.
You might be interested in LiveAddress which transforms addresses into lat/lon and can process thousands of requests per second. It's geo-distributed across 3 data centers and has a RESTful endpoint. You can do up to 100 addresses per request. There's also a list processing version if you have an Excel or CSV file or something like that.
The highest price tag is $10k, but it gives you unlimited lookups for a year.
Some sample code is at https://github.com/smartystreets/LiveAddressSamples.
Their license agreement has no such restrictions to limit your usage. Dbaseman is right: you're getting limit errors because it's a violation of the TOS (unless you get a business license from them, but even then the addresses are "best guess" -- not standardized and verified like with a CASS-Certified service. That's something to keep in mind).
回答2:
Have you looked into Nominatim? You can roll your own over OpenStreetMaps data, or you can send requests to OpenStreetMaps or MapQuest. Possible downsides include the CC license (requires attribution, may or may not be a problem for you) and the verification issue (data is almost entirely crowdsourced, so inaccuracies do happen). Upsides include less restrictive usage policy, frequent updates, worldwide coverage, and of course, you can't beat the price.
See https://jsfiddle.net/4hzzrws5/
var Data =[
{address: "17 rue de l'Abreuvoir. Nantilly. 28260 La Chaussée d'Ivry"},
{address: "52 rue Ernestine 95100 Argenteuil"},
{address: "3 allée Baudelaire 59139 Wattignies"},
{address: "165, Petit chemin d'aix 13320 Bouc Bel Air"},
{address: "54 avenue Yolande d'Aragon 49100 ANGERS"},
{address: "John Doe, Le Rouho Guidel 56520"},
{address: "51100"},
{address: "21 rue du Docteur Gallet - 74000 Annecy"},
{address: "4 Impasse des Cigales, 26500 Bourg lès Valence"},
{address: "83140 SIX FOURS LES PLAGES"},
{address: "35 cours Vitton 69006 Lyon"},
{address: "7 rue lallier 75009"},
{address: "Paul Michel, Villa Pétricciù,Ghjassu Pétricciù, 20221.CERVIONE"}
]
var cityAndCountry = function(res){
var osmObj= res[0].address,
city=osmObj.town || osmObj.city || osmObj.county || '',
country=osmObj.country || '',
iso2 =osmObj.country_code || '';
var out = [ city, country, iso2];
return out
}
var latAndLon = function(res){
var lat= res[0].lat,
lon= res[0].lon;
var out = [lat,lon];
return out
}
var queryOsm = function(url) {
$.getJSON(url, function (data) {
data.length==0?
console.log(["","",""],data)
:console.log(cityAndCountry(data),latAndLon(data),data);
});
}
var delayedPing = function (i,data) {
// console.log(i, data.length)
var d = data[data.length-i];
if(d.address){
// placeAddressOnMap(gc, d.address, d.service||"", d.customer||"")
var url = 'https://nominatim.openstreetmap.org/search/'+d.address+'?format=json&addressdetails=1&limit=1';
queryOsm(url)
} else { console.log(["","","",d.address]) }
var delay = 1000+200*Math.random();
if (--i > 0) { setTimeout(function () { delayedPing(i,data); }, delay); }
}
delayedPing(Data.length,Data);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
回答3:
No there isn't, and if you look into their licensing, it is explicitly designed to prevent you from using their service like that. Basically, you are only meant to use it if
- an end-user initiates each request to the API, and
- your service is free.
They also prohibit you from saving/caching results of their service to a database. Google makes it easy to prototype using their tools, but once you start to scale up you are going to pay (not so different from M$ in that regard).
回答4:
Following options may suite you
- GeoNames
- Gisgraphy
- GeoCoder
I directly communicated with Google about Google Maps licensing issue. Unfortunately they don't realize that great market share being lost due to the cost.
回答5:
just try this YUI
Usage Limits
Per application limit (identified by your Access Key): 100,000 calls per day
Per IP limits: /v1/public/: 1,000 calls per hour; /v1/yql/: 10,000 calls per hour
ZIP / Postal Code + Country to Geo Coordinates
来源:https://stackoverflow.com/questions/9960844/is-there-way-to-do-batch-geocoding-get-lat-lon-by-address-and-vice-versa