Corridor/Segment Flow Analysis API
The getCorridorOriginDestinationMatrix queryType generates a list of origin, destination, and connector flows and the various journey metrics for flow-based journeys.
Parameters
These parameters should be passed to the functionParameters object regardless of which method you choose to make an API request.
| Parameter | Description | Type | Defined Value Set | Value Required |
|---|---|---|---|---|
queryType | Must equal getCorridorOriginDestinationMatrix. | STRING | getCorridorOriginDestinationMatrix | Y |
aggregationUnits |
The requested time series aggregation units to be included in time series breakdowns. This attribute determines which time series breakdowns are generated if
| ARRAY | "hour", "dayofweek", "daytype", "daytypehour" | N |
customAggregationValues | Array of objects representing custom hourly range buckets for time series breakdowns. The custom aggregation values have the
Note: An empty array will result in no additional time series breakdowns. Note: If both | ARRAY | - | N |
componentTimeRange |
An object representing the analysis time range. Each object contains:
| OBJECT | Component — ["start", "end", "both"] | Y |
connectorAndCondition | True if the vehicle must pass through all connectors for a given journey, false if it must pass at least one connector. Default is false. | BOOLEAN | True or false | N |
dateRanges |
An array of objects representing the date ranges of interest. Each object contains:
Note: Analysis outputs will be aggregated and returned over all date ranges combined unless you input true for
isTrendAnalysis, which returns results per date range.Note: This API allows for a maximum of 1 year between the earliest
DateFrom and the latest DateTo across all date ranges.Note: A maximum of 4 date ranges may be provided. Date ranges may not overlap.
Note: For analyses using segments, the basemap AsOfDate utilized corresponds with the first of the month associated with the greatest
DateTo across all date ranges. | ARRAY | - | Y |
daysOfWeek | An array of integers representing each week day. Can send an empty array to return all days. | ARRAY | [1,7] (1 = Sunday, 2 = Monday, etc.) | N |
generateTimeSeries |
An indicator of whether to generate a time series breakdown (true) or not (false) as a child analysis. Time series will be generated for each time aggregation in Note: The time series breakdown results can be retrieved using the
getSavedResults API. Pass the jobId value from this API call as the analysisJobId parameter and "getCorridorOriginDestinationMatrixTimeSeries" as the analysisType parameter value. | BOOLEAN | true or false | Y |
isMetric | True if you want the data returned to be metric, false if you want imperial. | BOOLEAN | True or false | Y |
isTrendAnalysis |
Pass true if you want your results grouped based on the Note: When set to true, this will be applied to both the main output and the time series output.
| BOOLEAN | true or false | N |
NAICS | An array of integers representing industry IDs. Can pass an empty array to return data for all industries. To get a list of available industries, use the getIndustries API. | INTEGER | - | N |
percentiles |
Array of integers representing the percentiles for which you would like data. The default, if not provided, is [15,85]. Note: Percentiles are calculated for journey distance and journey duration.
Note: Altitude enforces a minimum sample size to support the requested number of percentiles. The minimum sample size is 2.5 times the number of percentiles requested. Should the sample for a flow fall short of this minimum sample, the percentiles will not be returned.
| ARRAY | [1, 5, 10, 15, 20, 30, 40, 50, 60, 70, 80, 85, 90, 95, 99] | N |
tripChainCriteria |
An object that defines the trip chaining criteria to be applied for an analysis. Pass null if you wish to run without trip chaining. The object contains:
Default value is an empty object (no trip chaining). Note: If you pass an empty object, no trip chaining will be applied.
| OBJECT | maxStopDuration — [0, 15, 30, 60, 120, 480, 720] | N |
vehicleClasses |
An array of vehicle class objects where each object contains | ARRAY | For Vehicle Type: "Truck", "Passenger", "MPV", "Bus", "Other". To get all vehicle types, pass an empty array. | N |
vehicleClassSchemeId | Determines for which vehicle classification scheme you will receive data. See the Vehicle Class Schemas for a list of options. The default value is 2. | INTEGER | [1:5] | N |
vocations | An array of integers representing vocation IDs for vocations of interest. Can pass specific IDs or an empty array to return data for all vocations. | ARRAY | See Vocations for a list of vocation IDs and their mapping information. | N |
zoneConnectors |
An array of objects representing connector zones that a flow-based journey should pass through (subject to the
| ARRAY |
ZoneType — "Segment", "Custom", "State", "County", "City", "TAZ", "ZIP", "CTR", or "FSA". See Zones for details on how to structure the zone inputs for each zone type. | N |
zoneDestinations |
An array of objects representing the destination zones. Each object contains:
Note: Origins and destinations are cross joined to form the anchor points for flows. Any connectors included are overlaid onto each flow origin and destination.
Note: The origin and destination in a flow may not overlap. All flows that have the origin and destination overlapping will be flagged and excluded from the analysis.
| ARRAY |
ZoneType — "Segment", "Custom", "State", "County", "City", "TAZ", "ZIP", "CTR", or "FSA". Passthrough — "true", "false" or "only". See Zones for details on how to structure the zone inputs for each zone type. | Y |
zoneOrigins |
An array of objects representing the origin zones. Each object contains:
Note: Origins and destinations are cross joined to form the anchor points for flows. Any connectors included are overlaid onto each flow origin and destination.
Note: The origin and destination in a flow may not overlap. All flows that have the origin and destination overlapping will be flagged and excluded from the analysis.
| ARRAY |
ZoneType — "Segment", "Custom", "State", "County", "City", "TAZ", "ZIP", "CTR", or "FSA". Passthrough — "true", "false" or "only". See Zones for details on how to structure the zone inputs for each zone type. | 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 Altitude Support if this occurs. |
Primary Response Schema
| Attribute | Description | Data Type | Defined Value Set |
|---|---|---|---|
| AggregationDateRanges |
Array of objects representing the date ranges utilized for the aggregated metrics. Each object contains:
| ARRAY | - |
| ConnectorZones |
Array of objects representing the connectors that an OD flow passed through. Sorted by ZoneId, ISO_3166_2, and ZoneType. Each object contains:
| ARRAY | - |
| DailyJourneyCountAvg | The average daily number of journeys for the O/D flow. | FLOAT | - |
| DestinationZoneDescription |
Description of the destination zone when available, based on the type of zone:
For all other zones, this attribute is null. | 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 | - |
| FlowId |
Unique identifier representing each flow. The FlowId for a flow pairing is a farm hash applied to the concatenated flow string that incorporates the origin, destination, and connector(s) identification details. The following formatted string is hashed using a farm hash to form the FlowId for a flow:
Note: If there are multiple connectors in the flow, all of them will be included, ordered by ZoneId, ISO_3166_2, and ZoneType.
FlowIds are used for follow-on API requests like | INT64 | - |
| InterTripStopDurationAvg |
The average of the total stop duration that occurs during the OD flow. The stop duration during an OD flow is calculated as the sum of all stop durations between trips that comprise the OD flow. Note: If no trip chaining is applied (i.e.,
tripChainCriteria.maxStopDuration is 0), this value will also be 0. | FLOAT | - |
| InterTripStopDurationMed |
The median of the total stop duration that occurs during an OD flow. The stop duration during an OD flow is calculated as the sum of all stop durations between trips that comprise the OD flow. Note: If no trip chaining is applied (i.e.,
tripChainCriteria.maxStopDuration is 0), this value will also be 0. | FLOAT | - |
| InterTripStopDurationStdev |
The standard deviation of the total stop duration that occurs during an OD flow. The stop duration during an OD flow is calculated as the sum of all stop durations between trips that comprise an OD flow. Note: If no trip chaining is applied (i.e.,
tripChainCriteria.maxStopDuration is 0), this value will also be 0. | FLOAT | - |
| AnalysisJobId | JobId for the O/D flow. The job analysis jobId is required for follow-on API requests, for example getRouteAnalysis. | STRING | - |
| JourneyCount | The total number of journeys for the O/D flow. | INTEGER | - |
| JourneyMetricsByFuelType |
Array of objects representing journey count metrics for each fuel type. Each object contains:
| ARRAY | - |
| JourneyMetricsByIndustry |
Array of objects representing journey count metrics for each NAICS code 1. Each object contains:
| ARRAY | - |
| JourneyMetricsByVehicleClass |
Array of objects representing journey count metrics for each vehicle class. Each object contains:
| ARRAY | - |
| JourneyMetricsByVehicleClassVocation |
Array of objects representing journey count metrics for each vehicle class/vocation combination. Each object contains:
| ARRAY | - |
| JourneyMetricsByVehicleClassIndustry |
Array of objects representing journey count metrics for each vehicle class/industry combination. Each object contains:
| ARRAY | - |
| JourneyMetricsByVocation |
Array of objects representing journey counts for each vocation. Each object contains:
| ARRAY | - |
| JourneyDistanceAvg | The average distance traveled for the flow-based journey portion (first entry to Origin; last exit from Destination) for an O/D flow (kilometers or miles). | FLOAT | - |
| JourneyDistanceMed | The median distance traveled for the flow-based journey portion (first entry to Origin; last exit from Destination) for an O/D flow (kilometers or miles). | FLOAT | - |
| JourneyDistancePercentile |
Array of objects representing percentile flow-based journey (first entry to Origin; last exit from Destination) distance values for input percentiles. Each object contains:
Note: If no percentiles are input, the 15th and 85th percentiles are provided by default.
Note: Percentiles will only be provided if there are sufficient samples to calculate the requested number of percentiles. The minimum sample size is 2.5 times the number of percentiles requested.
| ARRAY | - |
| JourneyDistanceStdev | The standard deviation of the distance traveled for the flow-based journey portion (first entry to Origin; last exit from Destination) for an O/D flow (kilometers or miles). | FLOAT | - |
| JourneyDurationAvg | The average journey duration (minutes) for the flow-based journey portion (first entry to Origin; last exit from Destination) for an O/D flow (in minutes). | FLOAT | - |
| JourneyDurationMed | The median journey duration (minutes) for the flow-based journey portion (first entry to Origin; last exit from Destination) for the O/D flow (in minutes). | FLOAT | - |
| JourneyDurationPercentiles |
Array of objects representing percentile journey duration values for input percentiles. Each object contains:
Note: If no percentiles are input, the 15th and 85th percentiles are provided by default.
Note: Percentiles will only be provided if there are sufficient samples to calculate the requested number of percentiles. The minimum sample size is 2.5 times the number of percentiles requested.
| ARRAY | - |
| JourneyDurationStdev | The standard deviation of the journey duration (minutes) for an O/D flow (in minutes). | FLOAT | - |
| JourneyTripCountAvg |
The average number of trips per journey. Note: If no trip chaining is applied (i.e.,
tripChainCriteria.maxStopDuration is 0), this value will also be 1. | FLOAT | - |
| JourneyTripCountMed |
The median number of trips per journey. Note: If no trip chaining is applied (i.e.,
tripChainCriteria.maxStopDuration is 0), this value will also be 1. | FLOAT | - |
| JourneyTripCountStdev | The standard deviation of the number of trips per journey. | FLOAT | - |
| OriginZoneDescription |
Description of the origin zone when available, based on the type of zone:
For all other zones, this attribute is null. | 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 | - |
Sample Parameters
Sample parameters that should go inside your functionParameters object:
{
"aggregationUnits": [],
"componentTimeRange": {
"TimeFrom": "00:00:00",
"TimeTo": "23:59:59",
"Component": "Start"
},
"dateRanges": [
{
"DateFrom": "<YYYY-MM-DD>",
"DateTo": "<YYYY-MM-DD>"
}
],
"daysOfWeek": [],
"generateTimeSeries": true,
"isMetric": true,
"NAICS": [],
"percentiles": [5, 15, 85, 95],
"queryType": "getCorridorOriginDestinationMatrix",
"tripChainCriteria": {
"MaxStopDuration": 30,
"ShortJourneyDistanceThreshold": 2
},
"vehicleClasses": [],
"vehicleClassSchemeId": 2,
"vocations": [],
"zoneOrigins": [
{
"ZoneId": "<ZoneId>",
"ISO_3166_2": "<ISO_3166_2>",
"ZoneType": "<ZoneType>",
"Passthrough": "false"
}
],
"zoneConnectors": [
{
"ZoneId": "<ZoneId>",
"ISO_3166_2": "<ISO_3166_2>",
"ZoneType": "<ZoneType>"
}
],
"zoneDestinations": [
{
"ZoneId": "<ZoneId>",
"ISO_3166_2": "<ISO_3166_2>",
"ZoneType": "<ZoneType>",
"Passthrough": "false"
}
]
}