Route Search API - routing.calc_risk
Calculates the risk exposure for a given route (route) traveling at a given departure time (start_datetime) and speed (speed).
The execution method is JSON-RPC v2.0.
Endpoint
https://<api-server-endpoint>/api/v1/evwhapi/jsonrpc
Request Example
{
"jsonrpc": "2.0",
"method": "routing.calc_risk",
"params": [
{
"themes": [
"riskmap_peopleflow_congestiondegree_5min"
],
"start_datetime": "2018-08-23 13:00:00+09",
"speed": 30,
"route": [
{
"start_lonlat": [139.632911226, 35.457119237],
"end_lonlat": [139.631598771, 35.458785682],
"speed": 30
},
{
"start_lonlat": [139.631598771, 35.458785682],
"end_lonlat": [139.631511274, 35.458894001],
"speed": 30
},
{
"start_lonlat": [139.631511274, 35.458894001],
"end_lonlat": [139.630386392, 35.458302371],
"speed": 30
}
]
}
],
"id": "test-routing-calcrisk"
}
params
params
| key |
data type |
description |
default value |
| themes |
array of string |
Risk Map Theme Name |
required |
| route |
array of object |
Route |
required |
| start_datetime |
string (YYYY-MM-DD HH:MM:SS+TZ) |
Start Datetime |
required |
| speed |
number |
Default Travel Speed (km/h) |
required |
For each element of params.route
| key |
data type |
description |
default value |
| start_lonlat |
array of number |
Longitude and latitude of the starting point |
required |
| end_lonlat |
array of number |
Longitude and latitude of the end point |
required |
| start_datetime |
string (YYYY-MM-DD HH:MM:SS+TZ) |
Departure date and time of the starting point |
auto-configuration |
| speed |
number |
Travel speed on this route (km/h) |
auto-configuration |
- If start_datetime is not specified, it is calculated as follows
- If it is the first element of the route, start_datetime = params.start_datetime.
- If it is the second or later element of the route, it is calculated from the previous element.
- The validity of start_datetime is not verified (e.g., whether it is greater than or less than the preceding or following elements).
- If speed is not specified, speed = params.speed.
Output sample
{
"result": {
"total_risks": [
{
"theme": "riskmap_peopleflow_congestiondegree_5min",
"risk": 0.035574762439000006
}
],
"route": [
{
"start_lonlat": [139.632911226, 35.457119237],
"end_lonlat": [139.631598771, 35.458785682],
"start_datetime": "2018-08-23 13:00:00+09",
"speed": 30,
"risks": [
{
"theme": "riskmap_peopleflow_congestiondegree_5min",
"risk": 0.021995194051000002
}
]
},
...
]
},
"id": "test-risk-exposure",
"jsonrpc": "2.0"
}
Return Values
Returns a JSON object containing information on the total risk exposure and the risk exposure per route.
The unit of risk exposure is “risk-hours”. For example, the risk exposure for 1.5 hours of driving in a risk 2 area is 2 * 1.5 = 3.
result
| key |
data type |
description |
| total_risks |
array of object |
Risk exposure on the pathway |
| route |
array of object |
route |
For each element of total_risks
| key |
data type |
description |
| theme |
string |
theme name |
| risk |
number |
risk exposure |
For each element of result.route
| key |
data type |
description |
| start_lonlat |
array of number |
longitude and latitude of start point |
| end_lonlat |
array of number |
longitude and latitude of end point |
| start_datetime |
string (YYYY-MM-DD HH:MM:SS+TZ) |
departure date and time of the start point |
| speed |
number |
Travel speed on this route (km/h) |
| rirks |
array of object |
risk exposure on this route |
| theme |
string |
theme name |
- Returns the route of the request with the risks added.
- Each element of risks is the same as each element of total_risks.
- If start_datetime and speed are not specified in the request, the calculated values are added and returned.
Main limitations
- The calculation of risk exposure for each element of a
route uses the risk at the start_datetime of the element.
- The calculation of risk exposure for each element in a
route uses the maximum value of risk within the element. Even if the risk is greater or lesser within an element, no proportional calculation is performed.
- Only the moving risk is included in the risk exposure calculation. Even if you express the intention to “wait at the location” by specifying
start_datetime, the risk exposure while waiting is not included in the calculation.