전환 다중선 및 경로 토큰

이 시나리오는 Route Optimization API를 사용하여 경로 다중선이 포함된 경로 토큰을 생성합니다.

OptimizeToursRequest 메시지에서 populateTransitionPolylines(REST, gRPC)를 설정하여 OptimizeToursResponseShipmentRoute 전환에서 routePolyline (REST, gRPC) 및 routeToken (REST, gRPC) 필드를 생성합니다.

populateTransitionPolylines=true인 요청 예시 보기

{
  "populateTransitionPolylines": true,
  "model": {
    "shipments": [
      {
        "pickups": [
          {
            "arrivalLocation": {
              "latitude": 37.73881799999999,
              "longitude": -122.4161
            }
          }
        ],
        "deliveries": [
          {
            "arrivalLocation": {
              "latitude": 37.79581,
              "longitude": -122.4218856
            }
          }
        ]
      }
    ],
    "vehicles": [
      {
        "startLocation": {
          "latitude": 37.73881799999999,
          "longitude": -122.4161
        },
        "endLocation": {
          "latitude": 37.73881799999999,
          "longitude": -122.4161
        },
        "costPerKilometer": 1.0
      }
    ],
    "globalStartTime": "2024-02-13T00:00:00.000Z",
    "globalEndTime": "2024-02-14T06:00:00.000Z"
  }
}
    

populateTransitionPolylines=true를 사용하여 요청에 대한 응답 예 보기

{
  "routes": [
    {
      "vehicleStartTime": "2024-02-13T00:00:00Z",
      "vehicleEndTime": "2024-02-13T00:39:02Z",
      "visits": [
        {
          "isPickup": true,
          "startTime": "2024-02-13T00:00:00Z",
          "detour": "0s"
        },
        {
          "startTime": "2024-02-13T00:19:43Z",
          "detour": "0s"
        }
      ],
      "transitions": [
        {
          "travelDuration": "0s",
          "waitDuration": "0s",
          "totalDuration": "0s",
          "startTime": "2024-02-13T00:00:00Z",
          "routePolyline": {}
        },
        {
          "travelDuration": "1183s",
          "travelDistanceMeters": 8591,
          "waitDuration": "0s",
          "totalDuration": "1183s",
          "startTime": "2024-02-13T00:00:00Z",
          "routePolyline": {
            "points": "}{ieFlkdjV?A@I?E@K?S@K?GB]@W?C?G@O?C@E?E@EB_AB_@?G?Q?KAQCm@?MAOAU?K?A?C?CAK?K?A?A?A?CAC?QAM?KASAE?C?C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s@L_@FA?A?iBT{ARuAPeALWBYDgAL_AJ_@De@Fw@H_ALYB]Di@Hu@Hs@H]HC?_@F_@DYDc@D_@Dy@Ja@D}APYDI@E?QBO@uAPWDYBMBQ@E@C?YD}@L]Da@Fy@Hs@Fk@Hs@Fi@Fa@F_@DYB[Hw@HI@_AJ[DWDMBi@FO@w@JWDK@e@FM@g@Di@FSB]F_@F}@J[Da@D_@DUBeALG@UBe@F]F_@DiANoANu@F_@Di@Fq@JK@QB[D_ALs@JUBaAJy@J]D[@c@DgALg@F[Hw@Hq@HU@[DSsCMqBCWDSRC"
          },
          "routeToken": "CvMBCpoBMpcBGnwKJwIWCTqXLDcqhgCkvimDkSzlkpMC-vjWAaDKOd3tCNPWjgKY9ZoCABIkp-WKdQga3q4YIIiUZ4H3B1KNfwDrYPeL9O2eVJwjIWAzanUeGgsAIAW-AdIBAg8hCioJIAJwdXUNbR4bPWHfPD9FaRDGPkjIybzk-fDMxbIBIhdUUlBpWnQ2NkJNeTRrZVFQdy02ZjhRVRAFGjsKOQoYCg0KAggBEQAAAAAAgGZAEQrXo3A9YZRAEgAiGQoXVFJQaVpzV1ZCTXk0a2VRUHctNmY4UVUoASIVANvZE2tQPAWkpIsvQ700Jn8qVo_m"
        },
        {
          "travelDuration": "1159s",
          "travelDistanceMeters": 8765,
          "waitDuration": "0s",
          "totalDuration": "1159s",
          "startTime": "2024-02-13T00:19:43Z",
          "routePolyline": {
            "points": "{~teF`oejVHARCjAOr@IFx@NzBHtA?HBXBl@ZI^ENAl@It@IRC`AM~@KZEZE`@Gf@G`@GHAZEj@EZAfBUTCfC]ZE\\Gj@Gl@Gp@IREZE`AMRCf@E`@GVEXCj@G\\Ez@K\\Gf@ELCHA`@G\\C\\GRA|@MfAM`@Ep@Ih@G|@K\\ERCTCr@I~@K\\GXEPAp@I|@K\\EXE~@QbAKDATAzDe@VEd@ELALAVEVCNCHAVCRCLC^EVEPAZGj@Gn@I~ASj@I^E~BW^ENAtASn@GZE^E`AKd@I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Jb@\\XNXNVLTFv@T^Dn@H~@FjADGp@CbAAh@?BANA\\?HAb@EzA?NA^Ad@Ct@A\\Aj@Cp@Ab@Aj@Aj@Cb@?\\ANAj@AN?F?BA`@?B@D?@?B@BBF?@DH@@FLBHFJHLBFLVDHNXJRBHDD@DBD@DBB@@@B\\r@HNBF?@@B@D?B?B@D@R?J@L?P@B?B?@?@?@?J@J?B?B?@?J@T@N?LBl@@P?J?P?FC^C~@AD?DAD?BAN?F?BAVC\\?FAJ?RAJ?DAH?@"
          },
          "routeToken": "CvsBCqIBMp8BGoMBCisCFgtG1Hlkf4MAwCL3qQKkpALomZ4Ci7meAozjjAPP34kDmSPq3BeDoWEAEiQzanUe6iFiW5kIYp6_RksOUl0YSWqIhERXJcl7xeckmqblinUaCgALCSuQBwIAdR4qCTkbWSARAAocAzICAgE9aRDGPkU-QYY-SIWx4e-az6a28QEiF1RSUGladU8zQk15cmtlUVBvZnVyd0FzEAUaOwo5ChgKDQoCCAERAAAAAACAZkARCtejcD0ulEASACIZChdUUlBpWnQtVkJNeXJrZVFQb2Z1cndBcygBIhUA29kTa1qXXaY59KJpCuXOkxw-Vkw"
        }
      ],
      "metrics": {
        "performedShipmentCount": 1,
        "travelDuration": "2342s",
        "waitDuration": "0s",
        "delayDuration": "0s",
        "breakDuration": "0s",
        "visitDuration": "0s",
        "totalDuration": "2342s",
        "travelDistanceMeters": 17356
      },
      "routeCosts": {
        "model.vehicles.cost_per_kilometer": 17.356
      },
      "routeTotalCost": 17.356
    }
  ],
  "metrics": {
    "aggregatedRouteMetrics": {
      "performedShipmentCount": 1,
      "travelDuration": "2342s",
      "waitDuration": "0s",
      "delayDuration": "0s",
      "breakDuration": "0s",
      "visitDuration": "0s",
      "totalDuration": "2342s",
      "travelDistanceMeters": 17356
    },
    "usedVehicleCount": 1,
    "earliestVehicleStartTime": "2024-02-13T00:00:00Z",
    "latestVehicleEndTime": "2024-02-13T00:39:02Z",
    "totalCost": 17.356,
    "costs": {
      "model.vehicles.cost_per_kilometer": 17.356
    }
  }
}
    

OptimizeTourResponse의 경로 토큰으로 Navigation SDK에서 내비게이션 세션을 시작합니다. 탐색 세션은 Route Optimization API에서 반환한 경로를 따르려고 시도합니다. 동적 도로 상태로 인해 지정된 토큰으로 생성된 경로가 원래 경로와 다를 수 있습니다. 경로 토큰은 만료되지 않지만, 실제 경로가 계획된 경로에 얼마나 가까운지 최대화하려면 토큰 생성 후 최대한 빨리 경로 토큰을 사용하는 것이 좋습니다.

Route Optimization API에서 생성된 경로 토큰을 Navigator.setDestinations 메서드를 사용하여 Navigation SDK에 전달할 때는 ShipmentRoute 전환의 종료 위치와 일치하는 단일 대상을 지정해야 합니다.

경로 토큰에 관한 자세한 내용은 Android용 Navigation SDKiOS용 Navigation SDK의 경로 계획 문서를 참고하세요.

경로 다중선 인코딩에 관한 자세한 내용은 다중선을 참고하세요.