Closed OD API
The getZoneClosedOriginDestinationMatrix queryType generates a list of origin and destination pairs that contain various journey metrics for the origin and destination combo.
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 getZoneClosedOriginDestinationMatrix. | STRING | getZoneClosedOriginDestinationMatrix | 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 | - | 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. A maximum of 4 date ranges may be provided. | 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 "getZoneClosedOriginDestinationMatrixTimeSeries" 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, journey duration, and duration at destination.
| 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 the zones that a journey should pass through (subject to the
| 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. | N |
zoneDestinations |
An array of objects representing the destination zones. Each object contains:
| 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. | N |
zoneOrigins |
An array of objects representing the origin zones. Each object contains:
| 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. | 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 | Analysis job identifier for the O/D pair. This is required for follow-on API requests, for example getRouteAnalysis. | STRING | - |
| DailyJourneyCountAvg | The average daily number of journeys between the O/D pair. | 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 | - |
| 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. Note: If no trip chaining is applied (i.e.,
maxStopDuration is 0), this value will also be 0. | 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. Note: If no trip chaining is applied (i.e.,
maxStopDuration is 0), this value will also be 0. | 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. Note: If no trip chaining is applied (i.e.,
maxStopDuration is 0), this value will also be 0. | FLOAT | - |
| JourneyCount | The total number of journeys between the O/D pair. | 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 between an O/D pair (kilometers or miles). | FLOAT | - |
| JourneyDistanceMed | The median distance traveled between an O/D pair (kilometers or miles). | FLOAT | - |
| JourneyDistancePercentile |
Array of objects representing percentile journey 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 records to calculate the requested percentiles.
| ARRAY | - |
| 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 | - |
| 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 records to calculate the requested percentiles.
| ARRAY | - |
| 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.,
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.,
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 | - |
| OriginZoneType | Zone type of the Origin. | STRING | - |
| OriginZoneId | A unique identifier for the Origin zone. | STRING | - |
| ZonePairId | Unique identifier representing each O/D pair. IDs are used for follow-on API requests like getRouteAnalysis. | 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": "getZoneClosedOriginDestinationMatrix",
"tripChainCriteria": {
"maxStopDuration": 30,
"shortJourneyDistanceThreshold": 2
},
"vehicleClasses": [],
"vehicleClassSchemeId": 2,
"vocations": [],
"zoneConnectors": [],
"zoneDestinations": [
{
"ZoneId": "<ZoneId>",
"ISO_3166_2": "<ISO_3166_2>",
"ZoneType": "<ZoneType>"
}
],
"zoneOrigins": [
{
"ZoneId": "<ZoneId>",
"ISO_3166_2": "<ISO_3166_2>",
"ZoneType": "<ZoneType>"
}
]
}