location.speedlimit

The location.speedlimit command is used to find the speed limit at a specified location. 

Note:

There are no guarantees as to the accuracy of this API. Use at your discretion. The global data sources that provide the speed limit information are incomplete and do not accommodate considerations like construction, dynamic speed limits, and special zones (such as school zones or intersections). For best results, only use results that have a source of "maxspeed". See the "source" response parameter description below for more information.

TR50 Request


                        {
  "cmd": {
    "command": "location.speedlimit",
    "params": {
      "lat": 26.394056,
      "lng": -80.11554
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

lat

Float

Yes

The latitude of the location being requested.

lng

Float

Yes

The longitude of the location being requested.

TR50 Response

If the command is sent successfully a success message, and params list is returned. Otherwise, an error and error message will be returned.


                        {
  "cmd": {
    "success": true,
    "params": {
      "lat": 26.394056,
      "lng": -80.11554,
      "limitMph": 45,
      "limitKph": 72,
      "quality": "",
      "source": "maxspeed"
    }
  }
}
      

Response Parameters

Name

Type

Description

lat

Float

The latitude of the location requested.

lng

Float

The longitude of the location requested.

limitMph

Integer

Speed limit in Miles per hour.

limitKph

Integer

Speed limit in Kilometers per hour.

quality

String

The source quality of the data.

source

String

The source name of the data.

"maxspeed" - The speed limite was determined by associating it with a definitive speed limit record in the database (by location).

"highway-type" - The speed limit was determined by guessing based on the meta-data available for the road (# of lanes, classification, divided, etc).

"bad" - The speed limit could not be determined.

 

"name+" may be pre-pended on a source result, this indicates that the resulting road matches the name of the previous location entry increasing the likelyhood of a correct result.