Open-Ended OD API
The getOpenEndedOriginDestinationMatrix queryType generates journey metrics anchored on a single zone, returning traffic patterns across four Zone Flow Types.
The Open-Ended OD API introduces zone-centric analysis anchored on a single zone. Users anchor their analysis on a zone and the system discovers all traffic patterns, returning all four Zone Flow Types by default. Pass the getOpenEndedOriginDestinationMatrix queryType to the API to generate a list of origins, destinations, and connectors (anchor zone for E:E zone flow type), along with various journey metrics for zone flow-based journeys. At least one anchor zone must be passed to the API.
Zone Flow Types
A zone flow type represents a distinct traffic pattern in relation to an anchor zone (zone of interest):
- Internal-Internal (I:I): traversal that starts and ends in the anchor zone
- Internal-External (I:E): traversal that starts in the anchor zone and ends in a destination zone (excluding the anchor zone)
- External-Internal (E:I): traversal that starts in an origin zone (excluding anchor zone) and ends in the anchor zone
- External-External (E:E): traversal that starts in an origin zone (excluding anchor zone), passes through the anchor zone (represented as connector), and ends in a destination zone (excluding anchor zone)
queryType: getOpenEndedOriginDestinationMatrix
The getOpenEndedOriginDestinationMatrix queryType generates a list of origin, destination, and connector pairings along with various journey metrics for zone flow-based journeys anchored on one or more input zones.
The getOpenEndedOriginDestinationMatrix queryType is passed to the API to generate a list of origin, destination and connector (anchor zone for external-to-external zone flow type), and the various journey metrics for zone flow based journeys. This API allows the user to anchor their analysis in a single zone, and then identify traffic patterns associated with any/all of four available zone flow types.
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 |
STRING | getOpenEndedOriginDestinationMatrix |
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
The default is ["hour", "dayofweek", "daytype", "daytypehour"]. Note:
An empty array will return all available time series. Note:
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
|
ARRAY |
- |
N |
timeRange |
An object representing the analysis time range. Each object contains:
|
OBJECT |
- |
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 |
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 |
externalZoneType |
The zone type of the geospatial zones you would like returned for the external component of your zone flow analysis in I:E, E:I, and E:E zone flow types. |
STRING |
"state", "county", "city", "taz", "zip", "ctr", or "fsa" |
Y |
externalZoneFilterRadius |
Radius filtering criteria to be applied to external zones that are returned. A value of 0 applies no filter. Units are kilometers or miles depending on the |
INTEGER |
0 |
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 |
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 |
ARRAY |
- |
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, journey duration, and duration at destination. 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 zone flow fall short of this minimum, 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 want 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 |
|
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 |
zones |
An array of objects representing the anchor zone(s). Each object contains:
Note:
The following restrictions apply to the number of zones that may be input, relative to zone type. State: 1 maximum. County, City, TAZ, ZIP, CTR, FSA: 1000 maximum and 700,000 sq. km / 270,200 sq. mi maximum total area. |
ARRAY |
ZoneType - "custom", "state", "county", "city", "taz", "zip", "ctr", or "fsa". See Zones for details on how to structure the zone inputs for each zone type. |
Y |
zoneFlowTypes |
An array of strings representing the list of zone flow types to execute against input zones. If an empty array is provided, the value defaults to all four zone flow types. |
ARRAY |
|
N |
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 |
- |
| AnalysisJobId |
Job ID for the O/D flow. The analysis job ID is required for follow-on API requests, for example |
STRING |
- |
| ConnectorZoneId |
String representing the connector ZoneId that an O/D flow passed through. Contains a custom zone ID, standard zone ID (such as county ID, city ID, etc.), or segment ID. Note:
This attribute is only populated for an E:E zone flow type (External-External) and represents the anchor zone. |
STRING |
- |
| Connector_ISO_3166_2 |
String representing the connector ISO_3166_2 that an O/D flow passed through. Only contains the ISO code of the standard zone. Does not apply to custom zones or segments and can be set to null. Note:
This attribute is only populated for an E:E zone flow type (External-External) and represents the anchor zone. |
STRING |
- |
| ConnectorZoneType |
String representing the connector zone type that an O/D flow passed through. Note:
This attribute is only populated for an E:E zone flow type (External-External) and represents the anchor zone. |
STRING |
- |
| 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 |
- |
| 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 |
- |
| DurationAtDestinationPercentiles |
Array of objects representing percentile duration at destination values for input percentiles. Each object contains:
Note:
If no percentiles are input, the 15th and 85th percentiles are provided by default. Percentiles will only be provided if there are sufficient records to calculate the requested percentiles. |
ARRAY |
- |
| DurationAtDestinationStdev |
The standard deviation of the stop duration at the destination before the next journey (minutes). |
FLOAT |
- |
| 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 (anchor zone in E:E) identification details. The string hashed to form the FlowId follows these formats:
FlowIds are used for follow-on API requests like |
INT64 |
- |
| InterTripStopDurationAvg |
The average of the total stop duration that occurs during the O/D flow. The stop duration during an O/D flow is calculated as the sum of all stop durations between trips that comprise the O/D flow. Note:
If no trip chaining is applied (that is, |
FLOAT |
- |
| InterTripStopDurationMed |
The median of the total stop duration that occurs during an O/D flow. The stop duration during an O/D flow is calculated as the sum of all stop durations between trips that comprise the O/D flow. Note:
If no trip chaining is applied (that is, |
FLOAT |
- |
| InterTripStopDurationStdev |
The standard deviation of the total stop duration that occurs during an O/D flow. The stop duration during an O/D flow is calculated as the sum of all stop durations between trips that comprise an O/D flow. Note:
If no trip chaining is applied (that is, |
FLOAT |
- |
| 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 |
- |
| JourneyDistancePercentiles |
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. 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 for the flow-based journey portion (first entry to Origin; last exit from Destination) for an O/D flow (minutes). |
FLOAT |
- |
| JourneyDurationMed |
The median journey duration for the flow-based journey portion (first entry to Origin; last exit from Destination) for the O/D flow (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. 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 for an O/D flow (minutes). |
FLOAT |
- |
| JourneyTripCountAvg |
The average number of trips per journey. Note:
If no trip chaining is applied (that is, |
FLOAT |
- |
| JourneyTripCountMed |
The median number of trips per journey. Note:
If no trip chaining is applied (that is, |
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 |
- |
| OriginZoneType |
Zone type of the Origin. |
STRING |
- |
| OriginZoneId |
A unique identifier for the Origin zone. |
STRING |
- |
| ZoneFlowType |
A string representing the zone flow type that resulted in the flow:
|
STRING |
"I:I", "I:E", "E:I", "E:E" |
Sample Parameters
Sample parameters that should go inside your functionParameters object:
{
"aggregationUnits": ["hour"],
"dateRanges": [
{
"DateFrom": "<YYYY-MM-DD>",
"DateTo": "<YYYY-MM-DD>"
}
],
"daysOfWeek": [],
"externalZoneType": "county",
"externalZoneFilterRadius": 0,
"generateTimeSeries": true,
"isMetric": true,
"NAICS": [],
"percentiles": [5, 15, 85, 95],
"queryType": "getOpenEndedOriginDestinationMatrix",
"timeRange": {
"TimeFrom": "00:00:00",
"TimeTo": "23:59:59"
},
"tripChainCriteria": {
"maxStopDuration": 30,
"shortJourneyDistanceThreshold": 2
},
"vehicleClasses": [],
"vehicleClassSchemeId": 2,
"vocations": [],
"zones": [
{
"ZoneId": "<ZoneId>",
"ISO_3166_2": "<ISO_3166_2>",
"ZoneType": "<ZoneType>"
}
],
"zoneFlowTypes": ["I:I", "I:E", "E:I", "E:E"]
}
Time Series Response Schema
This breakdown result is only created if generateTimeSeries is set to true.
The time series breakdown results can be retrieved using the getSavedResults API. Pass the jobId value from the original API call as the analysisJobId parameter and "getOpenEndedOriginDestinationMatrixTimeSeries" as the analysisType parameter value.
Each aggregation unit and associated value that overlaps the journey accounts for that journey and contributes to its metrics. For example, a journey that starts at 01:00:00 and ends at 10:00:00 contributes to metrics for hours 1 through 10.
| Attribute | Description | Data Type | Defined Value Set |
|---|---|---|---|
| AggregationDateRanges |
Array of objects representing the date ranges utilized for the aggregated metrics. Each object contains:
|
ARRAY |
- |
| AggregationUnit |
The time-based unit by which to aggregate data. |
STRING |
"hour", "dayofweek", "daytype", "daytypehour" |
| AggregationValue |
The associated
|
STRING |
- |
| ConnectorZoneId |
String representing the connector ZoneId that an O/D flow passed through. Contains a custom zone ID, standard zone ID (such as county ID, city ID, etc.), or segment ID. Note:
This attribute is only populated for an E:E zone flow type (External-External) and represents the anchor zone. |
STRING |
- |
| Connector_ISO_3166_2 |
String representing the connector ISO_3166_2 that an O/D flow passed through. Only contains the ISO code of the standard zone. Does not apply to custom zones or segments and can be set to null. Note:
This attribute is only populated for an E:E zone flow type (External-External) and represents the anchor zone. |
STRING |
- |
| ConnectorZoneType |
String representing the connector zone type that an O/D flow passed through. Note:
This attribute is only populated for an E:E zone flow type (External-External) and represents the anchor zone. |
STRING |
- |
| 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 |
- |
| 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 |
- |
| 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 (anchor zone in E:E) identification details. The string hashed to form the FlowId follows these formats:
FlowIds are used for follow-on API requests like |
INT64 |
- |
| InterTripStopDurationAvg |
The average of the total stop duration that occurs during an O/D flow. The stop duration during an O/D flow is calculated as the sum of all stop durations between trips that comprise the O/D flow. Note:
If no trip chaining is applied (i.e., |
FLOAT |
- |
| InterTripStopDurationMed |
The median of the total stop duration that occurs during an O/D flow. The stop duration during an O/D flow is calculated as the sum of all stop durations between trips that comprise an O/D flow. Note:
If no trip chaining is applied (i.e., |
FLOAT |
- |
| JourneyCount |
The total number of journeys for the O/D flow. |
INTEGER |
- |
| 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 |
- |
| JourneyDistanceAvg |
The average distance 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 |
- |
| JourneyDurationAvg |
The average journey duration for the flow-based journey portion (first entry to Origin; last exit from Destination) for an O/D flow (minutes). |
FLOAT |
- |
| JourneyDurationMed |
The median journey duration for the flow-based journey portion (first entry to Origin; last exit from Destination) for the O/D flow (minutes). |
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 |
- |
| OriginZoneType |
Zone type of the Origin. |
STRING |
- |
| OriginZoneId |
A unique identifier for the Origin zone. |
STRING |
- |
| ZoneFlowType |
A string representing the zone flow type that resulted in the flow:
|
STRING |
"I:I", "I:E", "E:I", "E:E" |