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.

Note:

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.

Note:

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.

ParameterDescriptionTypeDefined Value SetValue Req'd
queryTypeMust equal getODSegmentAnalysis.STRING"getODSegmentAnalysis"Y
analysisJobIdWhen 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 getOriginDestinationMatrix API, it returns a ZonePairId string for each origin-destination pair. You can pass an array of ZonePairIds to see the segment info for each pair that you have run a route analysis for. Pass an empty array to get all segments for all route analyses that you have run.

Segment analysis results are only available for zone pairs for which you have also run a route analysis.

ARRAY-Y

Responses

CodeTypeDescription
200JSONThe requested data.
401JSONOccurs for various unauthorized tasks, such as not providing credentials in your parameters.
500JSONOccurs if an internal server error occurs. Contact altitudesupport@geotab.com if this occurs.

Response Schema

AttributeDescriptionData TypeDefined Value Set
AsOfDateThe 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-
DailyJourneyCountAvgThe average number of journeys that traversed the segment per day.INTEGER-
GeographyA GeoJSON string representing the geography of the segment.STRING-
JourneyCountTotal number of journeys that traversed the segment.INTEGER-
JourneyCountByIndustry

Array of objects representing journey count metrics for each NAICS code 1. Each object contains:

  • NAICS_Code_1 (integer) — NAICS code 1.
  • JourneyCount (integer) — number of journeys.
ARRAY-
JourneyCountByVehicleClass

Array of objects representing journey count metrics for each vehicle class. Each object contains:

  • SchemeId (integer) — vehicle class scheme identifier.
  • CategoryIndex (integer) — vehicle class category identifier.
  • VehicleClassIndex (integer) — vehicle class identifier.
  • VehicleClass (string) — vehicle class name.
  • JourneyCount (integer) — number of journeys.
ARRAY-
JourneyCountByVocation

Array of objects representing journey counts for each vocation. Each object contains:

  • VocationId (integer) — unique identifier for the vocation.
  • Vocation (string) — vocation name.
  • JourneyCount (integer) — number of journeys.
ARRAY-
RoadTypeOSM road type.STRING-
SegmentIdSegment 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-
SegmentNameRoad name, if available.STRING-
ZonePairIdUnique 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>]
}