時間依存の制限
このセクションでは、時間制限に関する通知を生成するルート検索クエストの例と、時間制限の間隔をタイムドメイン表記で表す方法を示します。
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'
{
"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"
}
}
]
}
]
}通知に記載されている時間制限
タイムドメイン形式の制限間隔:++*(t2){d5}(h0){h7}*(t2){d5}(h9){h15}+(t1){d1}(t7){d1}
-
+(t1){d1}(t7){d1}:日曜日と土曜日、終日。 -
*(t2){d5}(h9){h15}:月曜日から5日間 (月曜日から金曜日)、午前9時から開始して15時間 (午前9時から午後12時)。 -
*(t2){d5}(h0){h7}:月曜日から5日間 (月曜日から金曜日)、午前0時から開始して7時間 (午前0時から午前7時)。
次の制限が適用されます。
- 毎週、毎年、土曜日と日曜日の終日および午前0時から午前7時まで
- 毎年、毎週、月曜日から金曜日の午前9時から午前0時まで
先月の更新