Risk exposure calculation - routing.calc_risk
This document has been machine translated.
Calculates the risk exposure for a given route (route
) at a given starting time (start_datetime
) and speed (speed
).
JSON-RPC v2.0 is used as the execution method.
The unit of risk exposure is "risk-hours". For example, the risk exposure for 1.5 hours of driving in a risk 2 area would be 2 * 1.5 = 3.
Sample Request
{
"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"
}
Parameter
params
Key | Data Type | Details | 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) | Date and Time | Required |
speed | number | Default running speed (km/h) | Required |
For each element of params.route
Key | Data Type | Details | 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 ending point | Required |
start_datetime | string (YYYY-MM-DD HH:MM:SS+TZ) | Date and Time | optional |
speed | number | Running speed on this route (km/h) | optional |
- 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 total risk exposure and risk exposure per route.
result
Key | Data Type | Details |
---|---|---|
total_risks | array of object | Risk exposure on the route |
route | array of object | route |
For each element of total_risks
Key | Data Type | Details |
---|---|---|
theme | string | Risk Map Theme Name |
risk | number | Risk Exposure |
For each element of result.route
Key | Data Type | Details |
---|---|---|
start_lonlat | array of number | Longitude and latitude of the starting point |
end_lonlat | array of number | longitude and Latitude of the ending point |
start_datetime | string (YYYY-MM-DD HH:MM:SS+TZ) | Date and Time |
speed | number | Running speed on this route (km/h) |
rirks | array of object | Risk exposure on this route |
theme | string | Risk Map Theme Name |
- Returns the route of the request with 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 Restrictions
- The calculation of risk exposure for each element of a
route
uses the risk at thestart_datetime
of the element. - For each element in the
route
, the maximum risk of the element is used in the calculation of the risk exposure. 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.