Route
Request
The Route API is used to get the set of maneuvers between two different geographic coordinates (latitude/longitude) and includes real-time traffic.
GET https://apis.location.studio/geo/v2/route/json
Required Parameters
api_key |
String |
Your Location Studio API Key |
origin |
String |
The latitude must be in the range of -90.0 to 90.0 and longitude must be in the range of -180.0 to 180.0 otherwise HTTP Error Code 400 for Bad Request will result. |
destination |
String |
The latitude must be in the range of -90.0 to 90.0 and longitude must be in the range of -180.0 to 180.0 otherwise HTTP Error Code 400 for Bad Request will result. |
Optional Parameters
optimize |
String |
The optimization method for the route. • • • The default is |
vehicle |
String |
The type of vehicle that will be traveling the route. • • • • The default is |
avoid |
Sting |
Comma separated list of things to avoid. • • • • • • • The default is |
traffic_level |
String |
The available traffic options: • • • The default is |
Response
Description
-
destination
- indicates the place information of destination, it contains:-
airport
-
areaname
-
city
- city name of the returned address. -
coordinate
- contains the latitude and longitude value. -
country
- The country name in long form. For example, "United States". -
country_code
- The ISO 3166-1 three character country code. For example, "USA". -
formatted_address
- The returned address formatted as a single line of text. For example, "25381 Alicia Pky, Laguna Hills, CA 92653, USA". -
house_number
- The house number in the street. For example, "25381" in "25381 Alicia Pky". -
intersection
-
postal
- The postal code. -
state
- state name of the returned address. -
street
- street name of the returned address. -
type
- type of the returned address. The following values are supported:-
airport
-
street
-
intersection
-
postal
-
city
-
state
-
country
-
-
-
maneuver[ ]
- is an array indicating the navigation route.
Each maneuver within the array may contain the following fields:
-
bounds
- indicates the maneuver bounds. The properties are:-
maxLat
-
maxLon
-
minLat
-
minLon
-
-
command
- indicates the type of maneuver. See the Maneuver Commands list for details. -
coordinate
- contains the latitude and longitude of the turn. -
current_road_info` - describes the current road information.
The properties of current road are:
-
primary_name
-
secondary_name
-
distance
- indicates the length of the maneuver (in meters). -
heading
- indicates the direction of travel on the current street. -
is_stack_advise
- is a boolean value indicating whether to advise stacking to the next maneuver or not. -
max_instruction_distance
- instructs user to make a maneuver. This prevents user from being told to turn before passing all intermediate streets. -
segment[ ]
- is an array specifies the geometry of the maneuver, which is decoded from the polyline element.
-
Each segment has the following properties:
-
lat
-
lon
-
speed
- estimates travel speed (in meters/second). -
traffic_region
- defines a traffic reporting region present on this maneuver.
-
The properties of traffic region are:
-
length
- indicates the length of the portion of this traffic region which falls within this maneuver. -
location
- is a string uniquely identifies a TMC traffic location. -
start
- indicates the starting point of this traffic region relative to the start of this maneuver. -
turn_road_info
- describes turn road information.
The properties of turn road are:
-
primary_name
-
secondary_name
Turn road contains the following fields:
-
country_info
- indicates the country information where the road is located, including country code and driving side.-
origin indicates
- the place information of origin, it contains the same fields as destination. -
route_extents
- contains the extents of the full route. The following elements are include:-
bottom_right_coordinate
- defines the minimum latitude and longitude which bounds the entity described. -
top_left_coordinate
- defines the maximum latitude and longitude which bounds the entity described.
-
-
route_id
- indicates the unique identifier of the route. -
total_distance
- indicates the total distance from orgin to destination, unit as meter. -
estimated_travel_time
- indicates the estimated travel time of the route, unit as second. -
traffic_flow[ ]
- is an array indicating traffic flow data along the route.
-
The properties of traffic flow are:
-
age
- has two optional values: 0 for old data, 1 for new data. -
type
- has three optional values: 0 for historical, 1 for realtime, 2 for no data.
Each traffic flow contains the following list:
-
traffic_flow_item[ ]
- Each item has the following properties:-
color
- indicates the status or this traffic region. "R", "Y" or "G" are supported values. -
free_flow_speed
- indicates free flow traffic speed along this traffic region in meters/second. -
location
- is a string uniquely identifies a TMC traffic location. -
speed
- indicates traffic flow speed along this traffic region in meters/second.
-