Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps 谷歌地理编码服务-获得干净的街道名称_Google Maps_Google Geocoder - Fatal编程技术网

Google maps 谷歌地理编码服务-获得干净的街道名称

Google maps 谷歌地理编码服务-获得干净的街道名称,google-maps,google-geocoder,Google Maps,Google Geocoder,我正在使用谷歌地理编码服务(使用来自浏览器的get请求),并尝试获取干净的街道名称(没有前/后方向和后缀) 例如:如果我的地址是“华盛顿州西雅图贝托纳街3号公寓3307 W” 我只想知道街道名“Bertona”。 我的请求url: {clientId}&signature={PrivateKey} 有没有办法从服务中检索干净的街道名称?您可以从响应中的address\u components数组中检索街道名称: { "results":[ { "address_com

我正在使用谷歌地理编码服务(使用来自浏览器的get请求),并尝试获取干净的街道名称(没有前/后方向和后缀) 例如:如果我的地址是“华盛顿州西雅图贝托纳街3号公寓3307 W” 我只想知道街道名“Bertona”。 我的请求url: {clientId}&signature={PrivateKey}


有没有办法从服务中检索干净的街道名称?

您可以从响应中的address\u components数组中检索街道名称:

{
   "results":[
   {
        "address_components":[
        {
          "long_name":"3",
          "short_name":"3",
          "types":[
             "subpremise"
          ]
        },
        {
          "long_name":"3307",
          "short_name":"3307",
          "types":[
             "street_number"
          ]
        },
        {
           "long_name":"West Bertona Street",
           "short_name":"W Bertona St",
           "types":[
              "route"
           ]
         },
route
类型的组件包含长街道和短街道名称。这是您可以从地理编码API请求中获得的最干净的名称