除了Google Maps API以外,还有任何允许你进行反地理编码的网络服务(付费或免费)吗?
我的特定应用程序将可以访问纬度和经度,我需要能够获得美国邮政编码或州名。
我不能使用Google是因为其服务条款似乎表明如果您使用Google Maps API,则需要使用数据来显示Google地图。
我正在使用C# .Net框架,如果相关的话。
除了Google Maps API以外,还有任何允许你进行反地理编码的网络服务(付费或免费)吗?
我的特定应用程序将可以访问纬度和经度,我需要能够获得美国邮政编码或州名。
我不能使用Google是因为其服务条款似乎表明如果您使用Google Maps API,则需要使用数据来显示Google地图。
我正在使用C# .Net框架,如果相关的话。
Geonames可以为您提供地名或邮政编码:
http://ws.geonames.org/findNearbyPlaceName?lat=40.65&lng=-73.78
http://ws.geonames.org/findNearbyPostalCodes?lat=40.65&lng=-73.78
只要您注明出处并且每天查询不超过15000次,使用是免费的。如果需要更多次数,可以付费。
$.getJSON('https://nominatim.openstreetmap.org/reverse', {
lat: position.coords.latitude,
lon: position.coords.longitude,
format: 'json',
}, function (result) {
console.log(result);
});
$.getJSON('https://secure.geonames.org/countryCode', {
lat: position.coords.latitude,
lng: position.coords.longitude,
type: 'JSON',
username: 'demo'
}, function (result) {
console.log(result);
});
ArcGIS提供免费(和付费)API:
https://developers.arcgis.com/rest/geocode/api-reference/geocoding-reverse-geocode.htm
该API可为给定位置(经纬度)提供地址。它甚至不需要API密钥,但他们建议您获取一个免费的密钥以避免速率限制。
以下是一个示例API调用及其JSON响应:
来自MapQuest Open API的Nominatim搜索服务是免费的,没有请求限制(软限制为每秒1个)。
http://open.mapquestapi.com/nominatim/v1/reverse.php?format=json&lat=44.0776182&lon=-92.5296981
可以在这里找到TOS