Analysis Partial Histogram Result
Purpose
Get a partial histogram result by sending a POST request.
The analysis must have been created with tripStats enabled.
Request data
HTTPS Method: POST
For ease of viewing and identification:
- Parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required parameters table for their values. The generic request format is as follows.
Format
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/{id}/result/partial/histogram?key={Your_API_Key}&dateRange={dateRange}&timeRange={timeRange}&type={type}Example
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/123/result/partial/histogram?key={Your_API_Key}&dateRange=0&timeRange=0&type=HOURS_OF_DAYRequired parameters
Required parameters | Description |
|---|---|
| Analysis number id. Value: The analysis number id. |
| Authorization key for access to the API. Value: Your valid API Key. |
| Index of the date range. Value: Example: |
| Index of the time range. Value: Example: |
| Type of the histogram. Values: One of the following values:
|
Request POST body example
{ "origins": [0, 1, 2, 3], "destinations": [4, 5, 6, 7, 8], "vias": [10]}Request POST body stucture
Field | Description |
|---|---|
| List of regions’ indexes where trips started. Must not be empty. |
| List of regions’ indexes where trips ended. Must not be empty. |
| List of regions’ indexes where trips went through. Leaving it out, or sending an empty list, is not a wildcard: it selects the origin-destination view, that is only the entries whose via equals their destination. Send the indexes of all your regions to aggregate the full drill-down by via region. |
Required POST headers
Header | Value |
|---|---|
|
Response data
This response returns one histogram, merged over every origin, destination and via combination you
selected. It is available once the analysis reaches the ACCEPTED status.
Response example
{ "bucketInterval": 1, "unit": "HOUR", "histogram": { "4": 0.02, "5": 0.05, "6": 0.18, "7": 0.51, "8": 1.96, "9": 3.71, "10": 8.72, "11": 9.29, "12": 9.97, "13": 10.02, "14": 9.95, "15": 10.92, "16": 10.95, "17": 10.89, "18": 10.66, "19": 8.95 }}Response structure
Field | Description |
|---|---|
| Width of a single bucket, in the unit given by |
| Unit of the bucket keys: |
| Map from the lower bound of a bucket to the normalized trip count for the trips that fall into it. Only buckets that carry traffic are present. |
Reading the normalized trip count
Each value is the normalized trip count for this date range and time range. See Normalized probe counts.
- With
viasleft empty and every region listed inoriginsanddestinations, the buckets add up to about 100. A narrower selection adds up to less. - With
viasfilled in, a trip that passed through several of the selected regions is counted in several entries before they are merged, so the buckets add up to more than 100. AVG_SPEEDShas its own population: trips whose average speed could not be computed are left out of both the buckets and the total, so this histogram is not comparable cell by cell with the other three.- Histograms of two different results - a different
dateRangeortimeRange- have different denominators and must not be added together.
LENGTHS and DURATIONS describe the part of a trip that lies inside the analyzed regions, from
the origin region to the destination region. HOURS_OF_DAY is the hour at which the trip entered its
origin region, the same moment that decides which time range the trip is counted in.
Response types
Type | Buckets |
|---|---|
| Keys |
| No upper limit, |
| No upper limit, |
| No upper limit, |
Errors
If there is an error in the supplied parameters or any other internal problem, an error response is generated in the requested format.
Response codes
Code | Meaning & possible causes |
|---|---|
| OK |
| Bad request |
| Unauthorized |
| Forbidden |
| Not Found |