リクエストを送信する

基本ルート計算

フランクフルトからヴィースバーデンまでのトラックルートを計算するには、次の GET リクエストを送信します。

 GET https://fleet.ls.hereapi.com/2/calculateroute.json
    ?apiKey={YOUR_API_KEY}
    &mode=fastest;truck;traffic:disabled
    &driver_cost=10
    &waypoint0=50.10992,8.69030
    &waypoint1=50.00658,8.29096

上記のリクエストに対する応答では、次のハイレベルな要素が提供されます。

  • 代替ルートのリスト
  • 各ルートは、ウェイポイントと、そのリンクを含むウェイポイント間の脚で代替されます
  • 各ルートの代替ルートには、ルートの概要、全体的なプロパティ、およびコスト要因が含まれています
{
  response: {
    route: [
      {
        waypoint: [
          {
            linkId: "-52309151",
            mappedPosition: { latitude: 50.10992, longitude: 8.6903 },
            originalPosition: { latitude: 50.10992, longitude: 8.6903 },
            spot: 0.49966,
            seqNrOnRoute: 0,
            globalWayPointSeqNr: 0
          },
          {
            linkId: "-52369550",
            mappedPosition: { latitude: 50.0066, longitude: 8.29095 },
            originalPosition: { latitude: 50.00658, longitude: 8.29096 },
            spot: 0.49505,
            seqNrOnRoute: 1,
            globalWayPointSeqNr: 1
          }
        ],
        leg: [
          {
            link: [
              {
                linkId: "-52309151",
                length: 129,
                remainTime: 2640,
                remainDistance: 42032,
                shape: [50.10997, 8.6894, 50.10988, 8.6912],
                functionalClass: 5
              },
              ...
              {
                linkId: "-52369550",
                length: 77,
                remainTime: 0,
                remainDistance: 0,
                shape: [50.00671, 8.29146, 50.00667, 8.2912, 50.00646, 8.29046],
                functionalClass: 5
              }
            ],
            maneuver: [
              {
                position: { latitude: 50.10988, longitude: 8.6912 },
                instruction: "Turn<span class="direction"> right </span>onto <span class="next-street">Schützenstraße</span>. <span class="distance-description">Go for <span class="length">52 m</span>.</span>",
                travelTime: 42,
                length: 52,
                id: "M2"
              },
              ...
              {
                position: { latitude: 50.0066, longitude: 8.29095 },
                instruction: "Arrive at <span class="next-street">Salzburger Straße</span>.",
                travelTime: 25,
                length: 0,
                id: "M12"
              }
            ]
          }
        ],
        summary: {
          travelTime: 2644,
          distance: 42032,
          baseTime: 2644
        },
        cost: {
          totalCost: "7.35",
          details: {
            driverCost: "7.35",
            vehicleCost: "0.0",
          }
        }
      }
    ],
    warnings: [
      {
        message: "some warning",
        code: 2
      }
    ]
  }
}

」に一致する結果は 件です

    」に一致する結果はありません