标签: google-geocoding-api

谷歌地图地理编码API V3使用wifi搜索确定,但通过数据连接响应OVER_QUERY_LIMIT

我的Google地图活动使用Google Maps Geocoding API V3搜索地址.
我有时会看到,即使我按顺序多次重复搜索,当我连接数据连接时,Google地图的响应也是OVER_QUERY_LIMIT.
在应用程序安装到设备上后,它也会在第一次搜索时发生.
当我与wifi连接时,它完美无缺.
这是我的代码.
搜索方式:

public static JSONObject getAddressInfo(String sAddress) {
    HttpGet httpGet = new HttpGet("http://maps.google.com/maps/api/geocode/json?address=" + sAddress + "&region=it&language=it&sensor=false");
    HttpClient client = new DefaultHttpClient();
    HttpResponse response;
    StringBuilder stringBuilder = new StringBuilder();

    try {
        response = client.execute(httpGet);
        HttpEntity entity = response.getEntity();
        InputStream stream = entity.getContent();
        int b;
        while ((b = stream.read()) != -1) {
            stringBuilder.append((char) b);
        }
    } catch (ClientProtocolException e) {
    } catch (IOException e) {
    }

    JSONObject jsonObject = new JSONObject(); …
Run Code Online (Sandbox Code Playgroud)

android android-maps google-geocoding-api

2
推荐指数
1
解决办法
2413
查看次数

Google和Apple的反向地理编码比较

我需要比较GoogleApple的反向地理编码

我正在开发一款适用于iOS的应用程序并计划将其移植到Android,而Google和Apple地理编码器提供的名称将是相同的,这一点至关重要.

我比较了他们在某些地方的工作方式,但没有看到差异.但事实上,我没有找到它并不意味着没有一个.

所以我的问题是:Apple和Google反向地理编码器给出的名称是不同的?

reverse-geocoding ios google-geocoding-api clgeocoder

2
推荐指数
1
解决办法
2588
查看次数

谷歌地理编码 XML 响应删除公寓/套房号码

使用 Geocode API 时,原始地址中的任何嵌入式公寓或套房编号似乎都在 XML 响应中被删除。这使得无法使用返回的地址作为“更正”或“标准化”格式进行保存。

  1. 有没有办法保存地址信息?

  2. 其次,在这种情况下,“apt B”代表与“A、C、D、E等”不同的建筑物。因此不同的屋顶地理编码。

任何帮助表示赞赏

发送以下地址:1135 Thomas Ln。Apt B, Hixson, TN 37343 到以下 URL(已删除密钥)"https://maps.googleapis.com/maps/api/geocode/xml?address=[ADDRESS]&key=[KEY]"

导致以下响应:

<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
 <status>OK</status>
 <result>
  <type>street_address</type>
  <formatted_address>1135 Thomas Lane, Hixson, TN 37343, USA</formatted_address>
  <address_component>
   <long_name>1135</long_name>
   <short_name>1135</short_name>
   <type>street_number</type>
  </address_component>
  <address_component>
   <long_name>Thomas Lane</long_name>
   <short_name>Thomas Ln</short_name>
   <type>route</type>
  </address_component>
  <address_component>
   <long_name>Hixson</long_name>
   <short_name>Hixson</short_name>
   <type>neighborhood</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Chattanooga</long_name>
   <short_name>Chattanooga</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Hamilton County</long_name>
   <short_name>Hamilton County</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Tennessee</long_name>
   <short_name>TN</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United States</long_name>
   <short_name>US</short_name>
   <type>country</type>
   <type>political</type> …
Run Code Online (Sandbox Code Playgroud)

google-maps geocoding google-geocoding-api

2
推荐指数
1
解决办法
3802
查看次数

Ggmap"dsk"速率限制

我正在尝试使用R库Ggmap对地图进行地理定位.

location_google_10000 <- geocode(first10000_string, output = "latlon",
    source = "dsk", messaging = FALSE)
Run Code Online (Sandbox Code Playgroud)

问题是我正在使用"dsk" - 数据科学工具包API-因此它没有速率限制为谷歌(限制为每天2500坐标).但是,当我尝试使用包含超过2500的向量运行时,它会弹出以下消息:

Error: google restricts requests to 2500 requests a day for non-business use.
Run Code Online (Sandbox Code Playgroud)

我尝试使用带有1000个地址的dsk运行代码,然后检查是否实际使用了google或dsk api:

> geocodeQueryCheck()
2500 geocoding queries remaining.
Run Code Online (Sandbox Code Playgroud)

所以出于某种原因,它不允许我使用超过2500与"dsk",但我相信它不使用谷歌.

geocoding r geolocation google-geocoding-api ggmap

2
推荐指数
1
解决办法
1071
查看次数

无法在“ file_get_contents()”中加载cafile流?

我正在尝试从Google地理编码API获取JSON数据。但是,PHP警告显示有关“无法加载cafile流”的一些错误

这是我的代码:

$apiKey  = 'apikey';
$address = urlencode( '1600 Amphitheatre Pkwy, Mountain View, CA 94043' 
);
$url     = "https://maps.googleapis.com/maps/api/geocode/json?address= 
    {$address}key={apiKey}";
$resp    = json_decode( file_get_contents( $url ), true );
echo $url;

$lat    = $resp['results'][0]['geometry']['location']['lat'] ?? '';
$long   = $resp['results'][0]['geometry']['location']['lng'] ?? '';
Run Code Online (Sandbox Code Playgroud)

这是错误:

PHP Warning:  failed loading cafile stream: `C:\xampp\apache\bin\curl-ca- 
bundle.crt' in C:\Users\1\Desktop\test.php on line 7

Warning: failed loading cafile stream: `C:\xampp\apache\bin\curl-ca- 
bundle.crt' in C:\Users\1\Desktop\test.php on line 7
PHP Warning:  file_get_contents(): Failed to enable crypto in 
C:\Users\1\Desktop\test.php on line 7

Warning: file_get_contents(): …
Run Code Online (Sandbox Code Playgroud)

php google-geocoding-api

2
推荐指数
1
解决办法
3337
查看次数

Google地理编码API仅适用于一个字地址

如果我只使用一个单词,谷歌地理编码api的工作非常好

悉尼

但如果我使用:

悉尼,澳大利亚

它不起作用它说:

警告:file_get_contents(https://maps.google.com/maps/api/geocode/json?address=sydney,Australia&sensor = false):无法打开流:HTTP请求失败!HTTP/1.0 400错误请求

虽然我粘贴这个url时它在我的浏览器中有效,但是当我使用这个功能时却file_get_contents没有.

我的问题很简单,当我粘贴此结果时,为什么它在我的浏览器中有效,以及为什么它不能与下面的代码一起使用.当然,如何解决这个问题.

$a = file_get_contents("https://maps.google.com/maps/api/geocode/json?address=sydney, Australia&sensor=false");
Run Code Online (Sandbox Code Playgroud)

php geocoding file-get-contents google-geocoding-api

1
推荐指数
1
解决办法
2138
查看次数

使用Google Maps API对模糊地址进行地理编码

在过去(大约在2015年1月左右),当我将地址片段发送到google maps API时,我会找回与我的地址片段匹配的内容列表.例如,如果我输入"16 Crystal Street",我曾经获得可能的匹配列表.现在,我得到一个部分匹配的结果.

有没有办法让google maps API返回一个与地址片段匹配的地址列表?

在java API中,例如:

public GeocodingResult[] queryService()
{
    GeoApiContext context = new GeoApiContext().setApiKey(Geocoder.GOOGLE_API_KEY);
    GeocodingResult[] results;
    try
    {
        results = GeocodingApi.geocode(context,"16 Crystal Street").await();            
        return results;
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }               

    return null;
}
Run Code Online (Sandbox Code Playgroud)

结果数组现在只有一个项目,而它用于包含多个与输入地址匹配的地址.

google-maps google-geocoding-api

1
推荐指数
1
解决办法
1237
查看次数

Google Map API:如何管理地理编码结果中的不同“address_components”?

考虑下面的谷歌地图地理编码响应的 JSON 响应。\n它由一个address_components包含五个元素的数组组成。\n通常开发人员使用其第一项(索引为 0 的项)来查找地址元素,例如 acroutelocalityformatted address。但这不是最好的选择。例如,在本例中,第二项比其他项更具描述性地址。有时,同一响应中会有不同地点的相同地址。

\n\n

我怎样才能选择更好的一个(例如,android中的Google Map API在可用项目中选择一个,但它并不总是索引为0的项目,但它在备选方案中进行选择,我想知道它将如何做到这一点并选择最佳匹配) ?

\n\n

此外,我想迭代不同的所有元素address_components以提取和汇集更精细的信息,但问题是同一类型元素的信息,例如不同的信息locality具有不同的信息address_components,当从不同的信息元素收集的信息元素时,会导致地址不一致。address_component项目。\n举个例子,在下面的示例中,我们有两个值\xd8\xb4\xd9\x87\xd8\xb1 \xd8\xac\xd8\xaf\xdb\x8c\xd8\xaf \xd8\xa7\xd9\x86\xd8\xaf\xdb\x8c\xd8\xb4\xd9\x87Karaj在不同的locality元素中,它们是两个不同的城市标签(在同一社区)。

\n\n

https://maps.googleapis.com/maps/api/geocode/json?latlng=35.7163931455472,51.01335000246763&key=xxxxx&language=fa

\n\n
{\n   "results" : [\n      {\n         "address_components" : [\n            {\n               "long_name" : "Unnamed Road",\n               "short_name" : "Unnamed Road",\n               "types" : [ "route" ]\n            },\n            {\n               "long_name" : "Karaj",\n               "short_name" : "Karaj",\n               "types" : [ "locality", "political" ]\n            },\n            {\n               "long_name" …
Run Code Online (Sandbox Code Playgroud)

android google-maps google-geocoding-api

1
推荐指数
1
解决办法
2056
查看次数

Google地理编码API - 有效邮政编码的零结果

我正在使用谷歌goecode API和一些邮政编码得到状态ZERO_RESULTS甚至'邮政编码存在(当搜索完整的地址,我可以找到它).

以下是我发送的请求(邮政编码:W1K6LX在英格兰):https://maps.googleapis.com/maps/api/geocode/json?component = postal_code:W1K6LX%7Ccountry:GB 因此,这给出了ZERO_RESULTS

但是当我搜索地址时:Kalrock 20 North Audley Street我可以在这里清楚地看到"London W1K 6LX":https://www.google.com/maps/place/Kalrock+Capital+Management/@51.5134013,-0.1556717 !,17Z /数据= 3M1 4B1 4M5 3M4 1s0x4876052eac174b5f:!!!!0xd76bd9d6e03653af8平方米3d51.513398 4D-0.153483

我在这里做错了吗?

google-maps google-api google-geocoding-api

1
推荐指数
1
解决办法
1660
查看次数

受限Google API密钥在反向地理编码中不起作用

我已经开发了具有Google Api的iPhone应用程序 https://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f&key=API_KEY

如果我使用Public apikey,那么它可以正常工作,但是当我从google concol生成严格的api密钥时,api无法正常工作并给出错误

    {
   "error_message" : "This IP, site or mobile application is not authorized to use this API key. Request received from IP address 27.109.**.**, with empty referer",
   "results" : [],
   "status" : "REQUEST_DENIED"
}
Run Code Online (Sandbox Code Playgroud)

生成受限的Api密钥时,我添加了有效的捆绑包ID。请给我解决方案,谢谢。

google-maps api-key google-maps-api-3 geocode google-geocoding-api

1
推荐指数
1
解决办法
632
查看次数