Analysis Partial Histogram Result
Request
Get partial histogram result by sending a POST request.
Format
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/{id}/result/partial/histogram?key={apiKey}&dateRange={dateRange}&timeRange={timeRange}&type={type}
Example
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/123/result/partial/histogram?key=test-api-key&dateRange=0&timeRange=0&type=HOURS_OF_DAY
Required POST Headers
Header | Value |
---|---|
Content-Type | application/json |
Parameters
Parameter | Description |
---|---|
apiKey | Authorization key for access to the API. |
dateRange | Index of date range. |
timeRange | Index of time range. |
type | Type of histogram. One of the following values:
|
Request body stucture
Field | Description |
---|---|
origins | List of regions' indexes where trips started |
destinations | List of regions' indexes where trips ended |
vias | List of regions' indexes where trips went through |
Request body example
1{2 "origins": [0,1,2,3],3 "destinations": [4,5,6,7,8],4 "vias": [10]5}
Response
This response will return array where each index is histogram’s bucket with information about number of trips which started in given origin, went through given vias and ended in given destinations. The array size depends on histogram type you choose:
type | size of array |
---|---|
HOURS_OF_DAY | 24 |
DURATIONS | no limitation (contains all durations buckets for minimal interval of 5 minutes) |
LENGHTS | no limitation (contains all length buckets for minimal interval of 1 kilometer) |
Response structure
Sample response for HOURS_OF_DAY histogram contains following data. Each value of histogram pairs is a number of trips which started in given origins, went through given vias and ended in given destinations for given hour.
Result interpretation example
1{2 "bucketInterval": 1,3 "unit": "HOUR",4 "histogram": {5 "4": 6,6 "5": 15,7 "6": 52,8 "7": 148,9 "8": 568,10 "9": 10766,11 "10": 39039,12 "11": 41573,13 "12": 44617,14 "13": 44866,15 "14": 44537,16 "15": 48869,17 "16": 49014,18 "17": 48767,19 "18": 47713,20 "19": 4006021 }22}
Errors
If there is an error in the supplied parameters or any other internal problem an error response is generated in the requested format.
HTTP Response Codes
Code | Reason |
---|---|
201 | Created |
400 | Bad request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |