使用Google地理编码api获取特定国家/地区的结果 [英] Get only country specific result using google geocode api
问题描述
我使用google geocode api来获取新加坡的邮政编码 。
我尝试了以下来获取数据:
(1) http: //maps.googleapis.com/maps/api/geocode/json?address=505468&sensor=false
(2)http://maps.googleapis.com/maps/api/geocode/json?address=Singapore %20505468& sensor = false
但它从印度返回位置
HTTPS:// DEVE lopers.google.com/maps/documentation/geocoding/?hl=fr#RegionCodes
以其他任何方式只获取特定国家/地区(新加坡)的结果。
我试过以下它会返回正确结果
http://maps.googleapis.com/maps/api/geocode/json?address=Singapore%20133224&sensor=false 要将结果限制到特定国家/地区,请使用组件过滤功能。 但这不是问题,地理编码结果是错误的,因为结果将国家设置为 我担心给定的地址(看起来邮编不存在),唯一可以做的就是向谷歌报告错误的结果。 I am using google geocode api for fetching lat long using postal code of singapore I have tried following to fetch data: (1) http://maps.googleapis.com/maps/api/geocode/json?address=505468&sensor=false (2) http://maps.googleapis.com/maps/api/geocode/json?address=Singapore%20505468&sensor=false (3) http://maps.googleapis.com/maps/api/geocode/json?address=Singapore%20505468&sensor=false®ion=sg But it returns location from India https://developers.google.com/maps/documentation/geocoding/?hl=fr#RegionCodes Any other way to get only country specific (Singapore) result. I have tried following it returns correct result http://maps.googleapis.com/maps/api/geocode/json?address=Singapore%20133224&sensor=false To restrict results to a specific country use the component-filtering. The url should be But that's not the issue here, the geocoder-result is wrong, because the result has the country set to I'm afraid with the given address(it appears that the postcode doesn't exists), the only thing you can do is to report the wrong result to google. 这篇关于使用Google地理编码api获取特定国家/地区的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ b $ b
SG
,但位置错误(置于印度)。
http://maps.googleapis.com/maps/api/geocode/json?address=Singapore%20505468&sensor=false&components=country:SG
SG
, but the location is wrong(placed in india).