ルーティングサービスでのタイムドメインの使用状況

このセクションでは、時間制限についての通知の結果となるルーティングリクエストの例、および時間制限の間隔がタイムドメイン表記によってどのように表されるかについて説明します。

# request
curl -X GET \
  'https://router.hereapi.com/v8/routes?origin=47.512627,19.049259&destination=47.5072999,19.0507577&return=polyline,summary&transportMode=bus&departureTime=2022-11-08T02:30:11&lang=en-us&apikey={YOUR_API_KEY}'

画像 : 時間制限の通知があるルート。

時間制限の通知があるルート
図 1. 時間制限の通知があるルート
// response with polyline omitted for brevity
{
  "routes": [
    {
      "id": "8490cccc-5728-4f1f-b78d-ba2c9518e9b4",
      "sections": [
        {
          "id": "56d26194-2e81-4662-9d00-5d84e992adc7",
          "type": "vehicle",
          "departure": {
            "time": "2022-11-08T02:30:11+01:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 47.5126642,
                "lng": 19.0492851
              },
              "originalLocation": {
                "lat": 47.5126269,
                "lng": 19.049259
              }
            }
          },
          "arrival": {
            "time": "2022-11-08T02:32:37+01:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 47.5073007,
                "lng": 19.0507227
              },
              "originalLocation": {
                "lat": 47.5072998,
                "lng": 19.0507577
              }
            }
          },
          "summary": {
            "duration": 146,
            "length": 1291,
            "baseDuration": 146
          },
          "polyline": "BGwl...3IgjB3ImDG",
          "notices": [
            {
              "title": "Violated vehicle restriction.",
              "code": "violatedVehicleRestriction",
              "severity": "critical",
              "details": [
                {
                  "type": "restriction",
                  "cause": "Route violates time-dependent restriction",
                  "timeDependent": true,
                  "restrictedTimes": "++*(t2){d5}(h0){h7}*(t2){d5}(h9){h15}+(t1){d1}(t7){d1}"
                }
              ]
            }
          ],
          "transport": {
            "mode": "bus"
          }
        }
      ]
    }
  ]
}

通知に記載されている時間制限 :

時間帯形式の制限間隔 : ++*(t2){d5}(h0){h7}*(t2){d5}(h9){h15}+(t1){d1}(t7){d1}

  • +(t1){d1}(t7){d1} : 日曜日と土曜日、 1 日の期間。

  • *(t2){d5}(h9){h15} : 月曜日から 5 日間 ( 月曜日から金曜日 ) 、午前 9 時から 15 時間 ( 午前 9 時から午前 12 時 ) の期間。

  • *(t2){d5}(h0){h7} : 月曜日から 5 日間 ( 月曜日から金曜日 ) 、午前 12:00 から午前 7:00 まで ( つまり、午前 12:00 から午前 7:00) の期間。

制限は、土曜日と日曜日、および 1 日の期間中、および月曜日から金曜日の午前 12 時 ~ 午前 7 時および午前 9 時 ~ 午前 12 時(毎週)に適用されます。

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

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