queryType: getSpeedMapMetrics*
The getSpeedMapMetrics queryType gets static road segment characteristic data about the selected region.
See Special Case APIs for more information.
This API call pulls data such as segment ID, Geography, speed limit and vehicle speed metrics like travel speed and vehicle count.
Parameters
| Parameter | Description | Type | Defined Value Set | Value Req'd |
|---|---|---|---|---|
| queryType | Must equal getSpeedMapMetrics. | STRING | getSpeedMapMetrics | Y |
| dateRange |
An object defining the analysis date range. Each object contains:
| OBJECT | - | 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 |
| excludeServiceRoads | True to exclude service roads, false to include them. Defaults to true. | BOOLEAN | - | N |
| isMetric | True if you want data to be returned in metric units, false if you want imperial. | BOOLEAN | true or false | Y |
| percentiles | Array of integers representing what percentiles you want the metrics broken up into. Default if not provided is [15,50,85]. | ARRAY | [1,99] | N |
| roadTypes | Array of strings representing the different road types for which you want data. Must pass at least one type. | ARRAY | List of OSM road types. See the Road Types table. | Y |
| timeRange |
An object representing the analysis time range. Each object contains:
The default is "00:00:00" to "23:59:59.999". | OBJECT | - | Y |
| vehicleClassSchemeId | Determines which vehicle classification scheme you will receive data for. See the Vehicle Class Schemas for a list of options. | INTEGER | [1,4] | Y |
| 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 on this link. To get all vehicle types, pass an empty array. | N |
| zones |
An array of objects representing the zones for which you want information. Each object contains
| ARRAY |
| 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 |
|---|---|---|---|
| TravelSpeedAvg | The average Travel Speed (mph or km/h). | FLOAT | - |
| ObservedCount | The aggregate number of observed vehicle passes for the road segment, given the applied filters. | INTEGER | - |
| RoadType | OSM road type. | STRING | See OSM Road Mapping. |
| SegmentId | The ID of the road segment. Segments come from breaking down OSM ways into smaller road segments. | STRING | - |
| SegmentLength | The length of the segment (miles or km) based on the value of isMetric. | FLOAT | - |
| SpeedLimit | Posted speed limit for this segment (mph or km/h). | INTEGER | - |
| SpotSpeedAvg | The average Spot Speed (mph or km/h). | FLOAT | - |
| SpotSpeedPercentiles |
Array of objects representing percentile spot speed values for input percentiles. Each object contains:
Note:
If no percentiles are input, the 15th, 50th and 85th percentiles are provided by default. | ARRAY | - |
| TravelTimeAvg | The average travel time (seconds). | FLOAT | - |
| VehicleCount | The aggregate number of vehicles observed for the road segment. | INTEGER | - |
Sample parameters
{
"dateRange":{"DateFrom":"2023-10-01", "DateTo":"2023-10-07"},
"isMetric":false,
"queryType":"getSpeedMapMetrics",
"roadTypes":['motorway'],
"timeRange":{"TimeFrom":"00:00:00", "TimeTo":"23:59:59.999"},
"vehicleClasses":[],
"vehicleClassSchemeId":2,
"zones":[{
"ZoneId":"32003",
"ISO_3166_2":"US-NV",
"ZoneType":"County"
}]
}