Google Directions API的start_address与输入中的来源不同

电池

我的Google Directions API请求是:

https://maps.googleapis.com/maps/api/directions/json?origin=41.43206,-81.38992&destination=41.43206,-81.48992&key=xxxxxxxx

我收到的回复是:

{
...
 "routes": [
{
  "bounds": {
    "northeast": {
      "lat": 41.4358763,
      "lng": -81.3897891
    },
    "southwest": {
      "lat": 41.4238459,
      "lng": -81.4910838
    }
  },
  "copyrights": "Map data ©2016 Google",
  "legs": [
    {
      "distance": {
        "text": "6.5 mi",
        "value": 10537
      },
      "duration": {
        "text": "14 mins",
        "value": 857
      },
      "end_address": "4743-4753 Country Ln, Warrensville Heights, OH 44128, USA",
      "end_location": {
        "lat": 41.4322651,
        "lng": -81.4910838
      },
      "start_address": "45 Bell St, Chagrin Falls, OH 44022, USA",
      "start_location": {
        "lat": 41.4318382,
        "lng": -81.3897891
      },
      "steps": [
        {
          "distance": {
            "text": "0.1 mi",
            "value": 191
          },
          "duration": {
            "text": "1 min",
            "value": 33
          },
          "end_location": {
            "lat": 41.4311157,
            "lng": -81.3918637
          },
          "html_instructions": "Head <b>southwest</b> on <b>Bell St</b> toward <b>Pleasant Dr</b>",
          "polyline": {
            "points": "_d{{FdmwoNFVRx@bA`EVbAVdA"
          },
          "start_location": {
            "lat": 41.4318382,
            "lng": -81.3897891
          },
          "travel_mode": "DRIVING"
        },
        ...
        {
          "distance": {
            "text": "0.2 mi",
            "value": 317
          },
          "duration": {
            "text": "1 min",
            "value": 32
          },
          "end_location": {
            "lat": 41.4322651,
            "lng": -81.4910838
          },
          "html_instructions": "Turn <b>left</b> onto <b>Country Ln</b><div style=\"font-size:0.9em\">Destination will be on the left</div>",
          "maneuver": "turn-left",
          "polyline": {
            "points": "ix{{FldkpNxJ?x@Ln@PnAX"
          },
          "start_location": {
            "lat": 41.4350887,
            "lng": -81.49079350000001
          },
          "travel_mode": "DRIVING"
        }
      ],
      "traffic_speed_entry": [],
      "via_waypoint": []
    }
  ],
  "overview_polyline": {
    "points": "_d{{FdmwoNvBvIVdAs@`@_Af@cCnAp@vCf@rBlAzEHd@`@nEFz@Cj@Or@{@nBUl@Q|@c@dGVZz@vAxDdGtBnDzCrEhAjCdAnCZ~Ap@bJJ`CAn@X\\\\r@hSx^hAxCn@pBXr@FbR?dCAz@ElAOhBe@xCkBvHqAtF]|BOhBG~BFpOFxBhBt\\r@vMBpA?zH?z\\CV?rV@V?nT?|QBvl@@vI@lJAdI?fDDhODxPHvq@?hB_@EgA?m@@EDyBBmCCqE?{FAkHB}E?cDEwBBcE?cKA_@?VdFl@fMp@pNd@fK@fJApCxJ?hB^nAX"
  }
...
}

为什么唯一的起始地址与请求中指定的起始地址不同?这两点相距6.5英里。

对于请求中指定的end_address和目标也是如此。

谢谢,Abhishek Batra

地理编码

DirectionsService反向地理编码将提供为坐标的任何位置,找到道路上最近的位置,并将其用作起点(或目的地)。

您的两点都碰巧在水里。

在此处输入图片说明 在此处输入图片说明

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章