我已经根据官方文档实现了客户端地理编码:
https://developers.google.com/maps/documentation/geocoding/
一切正常,但是,有一个缺点:结果总是使用一种语言,即使用language参数请求的语言。
我需要的是翻译成多种语言的地点,即我们网站可用的语言。这是一个例子:搜索“Geneva”会根据language参数产生一个结果地点:
en: 日内瓦de: 根夫fr: 日内瓦有没有办法只用一个 API 调用就获得所有三个翻译,还是我必须单独获取翻译?
谢谢你的提示!
我正在寻找一种网络服务或Google地方API类型的插件来检索地理位置,子地区和给定城市名称的区域.
一直在尝试使用谷歌和地名,但无法通过它.
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=hyderabad&types=(locality)&language=en_US&key=My_KEY
https://maps.googleapis.com/maps/api/geocode/json?/?address=hyderabad&key=My_KEY
Run Code Online (Sandbox Code Playgroud)
尝试过这两种方式.任何帮助,将不胜感激.
我正在使用谷歌地理编码API来使用Python 3.5测试以下Python代码.但是收到以下错误.代码是从Coursera的示例代码中复制的.我们假设能够测试任何位置.例如:密歇根州安娜堡
在加载JSON代码时有任何关于我为什么会遇到错误的想法:
从None> JSONDecodeError中提出JSONDecodeError("期望值",s,err.value):期望值
这是代码:
import urllib
import json
serviceurl = 'http://maps.googleapis.com/maps/api/geocode/json?'
while True:
address = input('Enter location: ')
if len(address) < 1 : break
url = serviceurl + urllib.parse.urlencode({'sensor':'false',
'address': address})
print ('Retrieving', url)
uh = urllib.request.urlopen(url)
data = uh.read()
print ('Retrieved',len(data),'characters')
js = json.loads(str(data))
Run Code Online (Sandbox Code Playgroud) 我想知道是否有可能在BigQuery的UDF中对谷歌地图地理编码api进行api调用?
我有谷歌分析地理领域,如
{
"geoNetwork_continent": "Europe",
"geoNetwork_subContinent": "Eastern Europe",
"geoNetwork_country": "Russia",
"geoNetwork_region": "Novosibirsk Oblast",
"geoNetwork_metro": "(not set)"
},
Run Code Online (Sandbox Code Playgroud)
并且想打电话给:
只是想知道我是否能够在UDF中使用javascript来为BigQuery中的每一行进行api调用.
将是非常强大的,并避免我必须在R或Python中做到这一点.
对UDF来说非常新手所以只是想问一下我的建议是否可行(想知道UDF中的外部api调用是否可能出于某种原因而出于安全问题,或者只是技术上不可能).
任何建议都非常感谢.
javascript user-defined-functions google-geocoding-api google-bigquery udf
我可以用来获取城市人口的优质python API是什么?我尝试使用地址解析器,但无法正常工作-不知道为什么。
geocoder.population('San Francisco, California')
Run Code Online (Sandbox Code Playgroud)
退货
'module' object has no attribute 'population'
Run Code Online (Sandbox Code Playgroud)
为什么会发生这种情况,我该如何解决?
或者,是否可以为此使用其他Python API?
python geocoding geography google-geocoder google-geocoding-api
我在Google Apps脚本网络应用程序中有以下代码:
Maps.newGeocoder().geocode("Tyson's Corner, VA");
Run Code Online (Sandbox Code Playgroud)
是的,那里有一个错字.我总是忘记这个地方的正确名称.
此代码使用Apps Script Maps Geocoder确定地址的位置.
当我运行此最小代码时,Apps脚本会引发错误:
不允许采取行动
当我'从地址中删除时,呼叫完成并返回正确的位置.
有谁知道这是否是预期的行为(我在文档中找不到它)?
我正在使用 google Geocode API 来获取特定地址的经纬度。
当我在谷歌搜索或谷歌地图中搜索“364 S Side Square, Carlinville, IL 62626, USA”时,它会在谷歌搜索结果或地图结果中提供准确的定位。
但同时,当我使用以下请求调用使用地理编码 API 搜索相同的地址时,它给出了“partial_match”:true
任何人都知道为什么它给出 "partial_match" : true 作为回应?
我必须在 API 请求中进行哪些更改才能获得“partial_match”?
api google-maps google-maps-api-3 google-geocoder google-geocoding-api
我正在尝试使用以下内容访问 Google 的地理编码 API:
我得到以下信息:
{"error_message":您必须使用 API 密钥来验证对 Google Maps Platform API 的每个请求。更多信息请参考http://g.co/dev/maps-no-account ", "results": [], "status": "REQUEST_DENIED"}
我传递的密钥与启用了地理编码和地点 API 的项目相关联,并且该项目也启用了计费。
curl google-maps google-api google-maps-api-3 google-geocoding-api
google geocoding api有组件限制。
行政区域、国家、地区、邮政编码、路线
我可以使用其中任何一个来按城市和城镇过滤吗?这样我就不会回到一个国家或州?
就像是
this.geocoder = new google.maps.Geocoder();
this.geocoder.geocode({
address: this.registerForm.get('city').value,
componentRestrictions: {
country: 'US',
locality // not sure here
}
},
(results, status) => {
if (status === google.maps.GeocoderStatus.OK) {}
}Run Code Online (Sandbox Code Playgroud)
我可以用谷歌地图自动完成!
this.autocomplete = new google.maps.places.Autocomplete(this.element, {
types: ['(cities)']
});Run Code Online (Sandbox Code Playgroud)
创建 Google 地图 API 密钥时,我们可以应用四个限制:-
现在,如果我们使用各自位置的钥匙,一切都会正常。
当我们想要使用 REST 从移动设备(android/ios)访问某些 API 时,问题就出现了,例如获取附近的位置以供用户输入。现在哪种限制适用于这种情况以及如何处理?
我已经尝试了所有限制,但不起作用。
提前致谢。
google-maps ×4
javascript ×2
python ×2
android ×1
api ×1
curl ×1
geocoding ×1
geography ×1
google-api ×1
json ×1
udf ×1