queryType: getODSegmentAnalysis*
The getODSegmentAnalysis queryType is passed to the API to get segment based metrics for origin-destination pair(s) that were generated by the getOriginDestinationMatrix and getRouteAnalysis API calls.
See Special Case APIs for more information.
Note that the sample response contains just one record/one segment, but your response will contain all the segments observed between the origin / destination pair that meet privacy requirements.
All returned metrics shown in the sample response below will be provided for each segment returned.
Parameters
These parameters should be passed to the functionParameters object regardless of which method you choose to make an API request.
For this API request to work, you must run both the getOriginDestinationMatrix and getRouteAnalysis APIs first, since the segments are derived as part of route generation and returned before route-specific privacy filtering.
| Parameter | Description | Type | Defined Value Set | Value Req'd |
|---|---|---|---|---|
| queryType | Must equal getODSegmentAnalysis. | STRING | "getODSegmentAnalysis" | Y |
| analysisJobId | When you generate an origin destination matrix from the getOriginDestinationMatrix API, it returns an analysisJobId string in the results, which is passed here. | STRING | - | Y |
| zonePairIds |
When you generate an origin destination matrix from the Segment analysis results are only available for zone pairs for which you have also run a route analysis. | ARRAY | - | Y |
Responses
| Code | Type | Description |
|---|---|---|
| 200 | JSON | The requested data. |
| 401 | JSON | Occurs for various unauthorized tasks, such as not providing credentials in your parameters. |
| 500 | JSON | Occurs if an internal server error occurs. Contact altitudesupport@geotab.com if this occurs. |
Response Schema
| Attribute | Description | Data Type | Defined Value Set |
|---|---|---|---|
| AsOfDate | The date for which OSM base map version to use. The value is provided in YYYY-MM-DD string format and reflects the first day of the applicable month. | DATE | - |
| DailyJourneyCountAvg | The average number of journeys that traversed the segment per day. | INTEGER | - |
| Geography | A GeoJSON string representing the geography of the segment. | STRING | - |
| JourneyCount | Total number of journeys that traversed the segment. | INTEGER | - |
| JourneyCountByIndustry |
Array of objects representing journey count metrics for each NAICS code 1. Each object contains:
| ARRAY | - |
| JourneyCountByVehicleClass |
Array of objects representing journey count metrics for each vehicle class. Each object contains:
| ARRAY | - |
| JourneyCountByVocation |
Array of objects representing journey counts for each vocation. Each object contains:
| ARRAY | - |
| RoadType | OSM road type. | STRING | - |
| SegmentId | Segment ID (also known as a Geotab segment ID that results from breaking down OSM ways into smaller road segments) or unique identifier for the segment. | STRING | - |
| SegmentName | Road name, if available. | STRING | - |
| ZonePairId | Unique identifier representing the O/D pair. | STRING | - |
Response Schema
| Attribute | Description | Data Type | Defined Value Set |
|---|---|---|---|
| AsOfDate | The date for which OSM base map version to use. The value is provided in YYYY-MM-DD string format and reflects the first day of the applicable month. | DATE | - |
| DailyJourneyCountAvg | The average daily number of journeys for the route. | FLOAT | - |
| DestinationZoneDescription |
Description of the origin zone when available. The is based on the type of zone:
| STRING | - |
| Destination_ISO_3166_2 | Unique ISO 3166-2 identifier representing the state/provincial code of the Destination. | STRING | - |
| DestinationPassThrough | Indicates the passthrough value applied to the destination. | STRING | “true”, “false” or “only” |
| DestinationZoneType | Zone Type of the Destination. | STRING | - |
| DestinationZoneId | A unique identifier for the Destination zone. | STRING | - |
| DurationAtDestinationAvg | The average stop duration at the destination before the next journey (minutes). | FLOAT | - |
| DurationAtDestinationMed | The median stop duration at the destination before the next journey (minutes). | FLOAT | - |
| DurationAtDestinationStdev | The standard deviation of the stop duration at the destination before the next journey (minutes). | FLOAT | - |
| Geography | A GeoJSON string representing the geography of the route. | STRING | - |
| IdleDurationAvg | The average of the total mid-journey idle duration (minutes). The mid-journey idle duration is calculated as a sum of the mid-trip idle duration of all trips that comprise the journey. | FLOAT | - |
| IdleDurationMed | The median of the total mid-journey idle duration (minutes). The mid-journey idle duration is calculated as a sum of the mid-trip idle duration of all trips that comprise the journey. | FLOAT | - |
| IdleDurationStdev | The standard deviation of the total mid-journey idle duration (minutes). The mid-journey idle duration is calculated as a sum of the mid-trip idle duration of all trips that comprise the journey. | FLOAT | - |
| InterTripStopDurationAvg | The average of the total stop duration that occurs during the journey. The stop duration during a journey is calculated as the sum of all stop durations between trips that comprise a journey. | FLOAT | - |
| InterTripStopDurationMed | The median of the total stop duration that occurs during the journey. The stop duration during a journey is calculated as the sum of all stop durations between trips that comprise a journey. | FLOAT | - |
| InterTripStopDurationStdev | The standard deviation of the total stop duration that occurs during the journey. The stop duration during a journey is calculated as the sum of all stop durations between trips that comprise a journey. | FLOAT | - |
| JourneyCountTotal | Total number of journeys for the O/D pair across all routes. | INTEGER | - |
| JourneyCount | The number of journeys observed on the route. | INTEGER | - |
| JourneyCountByIndustry |
Array of objects representing journey count metrics for each NAICS code 1. Each object contains:
| ARRAY | - |
| JourneyCountByVehicleClass |
Array of objects representing journey count metrics for each vehicle class. Each object contains:
| ARRAY | - |
| JourneyCountByVocation |
Array of objects representing journey counts for each vocation. Each object contains:
| ARRAY | - |
| JourneyCountPctOfTotal | The percentage of journeys that the route represents as a product of all journeys for the O/D pair. | INTEGER | - |
| JourneyDistanceAvg | The average distance traveled between an O/D pair (kilometers or miles). | FLOAT | - |
| JourneyDistanceMed | The median distance traveled between an O/D pair (kilometers or miles). | FLOAT | - |
| JourneyDistanceStdev | The standard deviation of the distance traveled between the O/D pair (kilometers or miles). | FLOAT | - |
| JourneyDurationAvg | The average journey duration (minutes) between the O/D pair (in minutes). | FLOAT | - |
| JourneyDurationMed | The median journey duration (minutes) between the O/D pair (in minutes). | FLOAT | - |
| JourneyDurationStdev | The standard deviation of the journey duration (minutes) between the O/D pair (in minutes). | FLOAT | - |
| JourneyTripCountAvg |
The average number of trips per journey. Note:
If no trip chaining is applied i.e. | FLOAT | - |
| JourneyTripCountMed |
The median number of trips per journey. Note:
If no trip chaining is applied i.e. | FLOAT | - |
| JourneyTripCountStdev | The standard deviation of the number of trips per journey. | FLOAT | - |
| OriginZoneDescription |
Description of the origin zone when available. The is based on the type of zone:
| STRING | - |
| Origin_ISO_3166_2 | Unique ISO 3166-2 identifier representing the state/provincial code of the Origin. | STRING | - |
| OriginPassThrough | Indicates the passthrough value applied to the origin. | STRING | “true”, “false” or “only” |
| OriginZoneType | Zone type of the Origin. | STRING | - |
| OriginZoneId | A unique identifier for the Origin zone. | STRING | - |
| RouteId | Internally generated unique reference ID for the sequence of segments traversed to form the route. | STRING | - |
| RoadNameSequence | String of all the sequential list of road names corresponding to the ordering of segments in the route. Format “<road name>, <road name>, <roadname>.…”. | STRING | - |
| RunningSpeedAvg | The average running speed (km/h or mph) for journeys. Running speed is calculated using only the time a vehicle is moving (excluding any time stopped). | FLOAT | - |
| RunningSpeedMed | The median running speed (km/h or mph) for journeys. Running speed is calculated using only the time a vehicle is moving (excluding any time stopped). | FLOAT | - |
| RunningSpeedStdev | The standard deviation of running speed (km/h or mph) for journeys. Running speed is calculated using only the time a vehicle is moving (excluding any time stopped). | FLOAT | - |
| SegmentSequence | String of the sequential segment IDs corresponding to the ordering of segments in the route. Format “<segment ID>, <segment ID>, <segment ID>…” | STRING | - |
| TravelSpeedAvg | The average travel speed (km/h or mph) for journeys. Travel speed is calculated as the total distance divided by the journey duration. | FLOAT | - |
| TravelSpeedMed | The median travel speed (km/h or mph) for journeys. Travel speed is calculated as the total distance divided by the journey duration. | FLOAT | - |
| TravelSpeedStdev | The standard deviation of travel speed (km/h or mph) for journeys. Travel speed is calculated as the total distance divided by the journey duration. | FLOAT | - |
| Variants |
Array of objects representing the variations of the route that are determined to be within the
| ARRAY | - |
| ZonePairId | Unique identifier representing the O/D pair. | STRING | - |
Sample parameters
{
"queryType": "getODSegmentAnalysis",
"analysisJobId": "<analysisJobId from response of getOriginDestinationMatrix API call>",
"zonePairIds": [<ZonePairId value(s) from response of getOriginDestinationMatrix API call>]
}