queryType: getStopAnalytics*
The getStopAnalytics queryType is passed to the API to get aggregate stopping and parking information for a given set of parameters.
See Special Case APIs for more information.
The data insights returned from this queryType can be used to assess stops for various use cases by leveraging the usage of different geographic aggregation modes.
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 |
|---|---|---|---|---|
| aggregationMode | Geographic aggregation mode. 0: By road segment 1: By related roads 2: By zone 3: By H3 4. By geohash 5. By S2 | INTEGER | [0,5] | Y |
| 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. | ARRAY | - | Y |
| daysOfWeek | 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 |
| fuelTypes | An array of strings representing the fuel types you want analyzed. Possible values are "Diesel", "Electric", "Flexible", "Gasoline", "Hybrid", "Other" and "Unknown". Refer to the Fuel types table for a description of each option. Can send an empty array to return all fuel types. | ARRAY | See Fuel types for a list of fuel types | - |
| hashHierarchy |
Whether to return hierarchy of hashes (true) or each level separately (false). Default value is false. Example: we have selected H# aggregation (mode 3) and chosen cell levels 5 (minCellLevel) through 7 (maxCellLevel). If we input false: we will get a result record for each contained H3 cell at level 5 through 7 that has valid results. If we input true: favors returning the highest level of granularity with the least amount of redundancy while still maintaining coverage of all stops i.e., we will only get a result record for contained H3 cells at level 5 through 7, for which all of their possible (where we have coverage) children cells cannot be returned. So if all of a particular level 6 H3 cells’ children have sufficient coverage, we will return those level 7 children and exclude the overarching level 6 H3 cell. If some of those level 7 children cannot be returned, we will return the level 6 H3 and all of its available children. Note:
These parameters only apply to aggregation mode 3, 4, and 5. | BOOLEAN | true or false | N |
| includeGeography |
Whether to include geography in the output (true) or not (false). Note:
For aggregationMode 3, 4, 5 and 6 this is forced to true. The default value is false for all other modes. | BOOLEAN | True or false | N |
| isMetric | True for data to be returned in metric units, false for imperial. | BOOLEAN | true or false | Y |
| maxCellLevel | Maximum cell level for H3, geohash, or S2 aggregation modes. Default value is 10 for H3, 7 for Geohash, and 16 for S2. | INTEGER |
Absolute Maxs:
| N |
| maxPostStopTripDistance | Maximum distance (miles or kilometers) of the trip after the stop to be included in the analysis. Default value is +inf. | FLOAT | - | N |
| maxPostStopTripDuration | Maximum duration (minutes) of the trip after the stop to be included in the analysis. Default value is +inf. | FLOAT | - | N |
| maxPreStopTripDistance | Maximum distance (miles or kilometers) of the trip before the stop to be included in the analysis. Default value is +inf. | FLOAT | - | N |
| maxPreStopTripDuration | Maximum duration (minutes) of the trip leading up to the stop to be included in the analysis. Default value is +inf. | FLOAT | - | N |
| maxStopDuration | Maximum duration (minutes) of the stop to be included in the analysis. Default value is +inf. | FLOAT | - | N |
| minCellLevel |
Minimum cell level for H3, geohash, or S2 aggregation modes. Default value is 5 for H3, 5 for Geohash, and 10 for S2. | INTEGER |
Absolute Mins:
| N |
| minPostStopTripDistance | Minimum distance (miles or kilometers) of the trip after the stop to be included in the analysis. Default value is 0. | FLOAT | - | N |
| minPostStopTripDuration | Minimum duration (minutes) of the trip after the stop to be included in the analysis in minutes. Default value is 0. | FLOAT | - | N |
| minPreStopTripDistance | Minimum distance (miles or kilometers) of the trip before the stop to be included in the analysis. Default value is 0. | FLOAT | - | N |
| minPreStopTripDuration | Minimum duration (minutes) of the trip leading up to the stop to be included in the analysis. Default value is 0. | FLOAT | - | N |
| minStopCount | Minimum number of stops an output zone must have post analysis to be included in the output dataset. | INTEGER | - | N |
| minStopDuration | Minimum duration (minutes) of the stop to be included in the analysis. Default value is 0. | FLOAT | - | N |
| NAICS | An array of integers representing industry IDs. Can pass an empty array to return data for all industries. To get list of available industries use the getIndustries API. | INTEGER | - | N |
| percentiles | Array of integers representing the percentiles for which you would like data. Default if not provided is [15,85] | ARRAY | [0, 99] | N |
| queryType | Must equal getStopAnalytics | STRING | “getStopAnalytics” | Y |
| relatedRoadTypes |
An array of strings representing related road types for which we want data. Note:
This filter is only applied when | ARRAY | List of OSM road types. Any value from the Road Types table excluding “tertiary”, “residential_link”, and “living_street” which are all included under “residential” | N |
| roadTypes |
Array of strings representing the different road types for which you want data. Empty array means all road types. Note:
This filter is only applied when | ARRAY | List of OSM road types. | N |
| stopDurationBins |
Array of integers representing the upper bounds (inclusive) of stop durations (minutes) bins on which to report aggregation metrics. The lower bound for a bin is the previous stop duration in the array (non-inclusive). If the user specifies a For example, the array [10, 30, 60] with no values for the parameter | ARRAY | - | N |
| timeRange |
An object representing the time range and whether trips should start in the time range, end in the time range, or both.
(Default 00:00:00 to 23:59:59.999) | OBJECT | - | N |
| vehicleClasses |
An array of vehicle class objects where each object contains | ARRAY |
See the Vehicle types and Weight class tables. For Vehicle Type: "Truck", "Passenger", "MPV", "Bus", "Other". More information at AFDC Vehicle Categories. To get all vehicle types, pass an empty array. | N |
| vehicleClassSchemeId | Determines which vehicle classification scheme you will receive data for. See the Vehicle class schemas for a list of options. The default value is 2. | INTEGER | [1,4] | 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 Vocation descriptions for a list of vocation ids and their mapping information. | N |
| zones |
An array of objects representing the zones for which you want information. Each object contains
| ARRAY |
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 e.g. if you didn’t provide 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 |
|---|---|---|---|
| Geography |
A GeoJSON string representing the geography of the zone. Note:
This attribute is only populated if | STRING | - |
| IdleDurationAvg | The average idle duration (minutes) before turning off ignition at the stop location. | FLOAT | - |
| IdleDurationMed | The median idle duration (minutes) before turning off ignition at the stop location. | FLOAT | - |
| IdleDurationPercentiles |
Array of objects representing percentile idle 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 | - |
| IdleDurationStdev | The standard deviation of idle duration (minutes) before turning off ignition at the stop location. | FLOAT | - |
| ISO_3166_2 | The ISO 3166:2 code for the state or province associated with the output zone, where available. | STRING | - |
| IsOneWay |
Whether the road segment is one-way (true) or not (false). Note:
A value is only returned for | BOOL | [True, False, NULL] |
| PostStopTripDistanceAvg | The average distance (miles or kilometers) of the trip after the stop. | FLOAT | - |
| PostStopTripDistanceMed | The median distance (miles or kilometers) of the trip after the stop. | FLOAT | - |
| PostStopTripDistancePercentiles |
Array of objects representing percentile trip distance values for the trip after the stop, 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 | - |
| PostStopTripDistanceStdev | The standard deviation of distance (miles or kilometers) of the trip after the stop. | FLOAT | - |
| PostStopTripDurationAvg | The average duration (in minutes) of the trip after the stop. | FLOAT | - |
| PostStopTripDurationMed | The median duration (in minutes) of the trip after the stop. | FLOAT | - |
| PostStopTripDurationPercentiles |
Array of objects representing percentile trip duration values for the trip after the stop, 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 | - |
| PostStopTripDurationStdev | The standard deviation of duration (in minutes) of the trip after the stop. | FLOAT | - |
| PreStopTripDistanceAvg | The average distance (in km or mi) of the trip leading to the stop. | FLOAT | - |
| PreStopTripDistanceMed | The median distance (in km or mi) of the trip leading to the stop. | FLOAT | - |
| PreStopTripDistancePercentiles |
Array of objects representing percentile trip distance values for the trip leading up to the stop, 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 | - |
| PreStopTripDistanceStdev | The standard deviation of distance (in km or mi) of the trip leading to the stop. | FLOAT | - |
| PreStopTripDurationAvg | The average duration (in minutes) of the trip leading to the stop. | FLOAT | - |
| PreStopTripDurationMed | The median duration (in minutes) of the trip leading to the stop. | FLOAT | - |
| PreStopTripDurationPercentiles |
Array of objects representing percentile trip duration values for the trip leading up to the stop, 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 | - |
| PreStopTripDurationStdev | The standard deviation of duration (in minutes) of the trip leading to the stop. | FLOAT | - |
| StopCount | The number of stop events occurring at the stop location. | INTEGER | - |
| StopDurationAvg | The average stop duration (in minutes). | FLOAT | - |
| StopDurationBins |
Array of objects representing count metrics for stop duration bins. Each object contains:
| ARRAY | - |
| StopDurationMed | The median stop duration (minutes). | FLOAT | - |
| StopDurationPercentiles |
Array of objects representing percentile stop 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 | - |
| StopDurationStdev | The standard deviation of stop duration (in minutes). | FLOAT | - |
| StopMetricsByDayOfWeek |
Array of objects representing stop metrics for a day of week, based on the day of week of arrival at the stop location (local time). Each object contains:
| ARRAY | DayOfWeek = [1:7], where 1 = Sunday and 7 = Saturday. |
| StopMetricsByDirection |
Array of objects representing stop metrics for each direction of travel on a road segment. Each object contains:
Note:
Values are only returned for | ARRAY |
Direction — 1 or -1 CardinalDirection — “N”, “S”, “E”, “W”, “NE”, “NW”, “SE” or “SW” |
| StopMetricsByFuelType |
Array of objects representing stop metrics for each fuel type. Each object contains:
| ARRAY | - |
| StopMetricsByHour |
Array of objects representing stop metrics for an hour, based on the hour of arrival at the stop location (local time). Each object contains:
| ARRAY | Hour - [0:23] |
| StopMetricsByHourParked |
Array of objects representing metrics for vehicles parked during an hour (local time). Each object contains:
Note:
A parking event is included in counts if it parked for any portion of the hour. | ARRAY | Hour - [0:23] |
| StopMetricsByIndustry |
Array of objects representing stop metrics for each NAICS code 1. Each object contains:
| ARRAY | - |
| StopMetricsByMonth |
Array of objects representing stop metrics for a month, based on the month of arrival at the stop location (local time). Each object contains:
| ARRAY | Month - [1:12] where 1=January, 2=February, etc |
| StopMetricsByVehicleClass |
Array of objects representing stop metrics for each vehicle class. Each object contains:
| ARRAY | - |
| StopMetricsByVocation |
Array of objects representing stop metrics for each vocation. Each object contains:
| ARRAY | - |
| VehicleCount | The number of unique vehicles contributing to the stop count. | INTEGER | - |
| VehicleCountTotal | The total number of unique vehicles in the entire analysis (not just one zone). | FLOAT | - |
| VocationFilter | User input vocation filter. | ARRAY | - |
| ZoneDescription |
Description of the zone when available. The is based on the type of zone:
For all other zones, this attribute is null. | STRING | - |
| ZoneId |
Unique identifier for the zone. This value is set based on the
| STRING | - |
| ZoneSubType |
The zone type subclassification value, where applicable. The zone type of the returned zone. Based on
| STRING | - |
| ZoneType |
The type of the returned zone. Based on
| STRING | - |
Sample parameters
{
"queryType": "getStopAnalytics",
"aggregationMode": 0,
"dateRanges": [{
"DateFrom": "2022-06-01",
"DateTo": "2022-06-30"
}],
"isMetric": false,
"zones": [{
"ZoneId": "32003",
"ISO_3166_2": "US-NV",
"ZoneType": "County"
}]
}