GuidesAPI Reference
Guides

Time-dependent restrictions

This section provides an example of a routing request that results in notices about time restrictions, and how time restriction intervals are represented through Time Domain notation.

curl -gX 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'
Route with time restriction notices
{
  "routes": [
    {
      "id": "8490cccc-5728-4f1f-b78d-ba2c9518e9b4",
      "sections": [
        {
          "id": "56d26194-2e81-4662-9d00-5d84e992adc7",
          "type": "vehicle",
          ...,
          "summary": {
            "duration": 146,
            "length": 1291,
            "baseDuration": 146
          },
          "polyline": "...",
          "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"
          }
        }
      ]
    }
  ]
}

Time restrictions reported in the notices

Restriction intervals in Time Domain format: ++*(t2){d5}(h0){h7}*(t2){d5}(h9){h15}+(t1){d1}(t7){d1}

  • +(t1){d1}(t7){d1} : On Sunday and Saturday, for duration of 1 whole day.

  • *(t2){d5}(h9){h15} : From Monday, for a duration of 5 days (that is, Monday to Friday), starting at 9 AM for a duration of 15 hours (that is, 9 AM to 12 PM).

  • *(t2){d5}(h0){h7} : From Monday, for a duration of 5 days (that is, Monday to Friday), starting at 12 AM for a duration of 7 hours (that is, 12 AM to 7 AM).

Restriction applies:

  • On Saturday and Sunday, for the duration of entire day, and from 12 AM to 7 AM, every week, every year
  • Monday to Friday, 9 AM to 12 AM, every week, every year