Directions
Request
The Directions API is used to get the set of maneuvers between two different geographic coordinates (latitude/longitude).
GET https://apis.location.studio/geo/v2/directions/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 fastest. |
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 |
Response
Description
When the service returns results from a directions request, it places them within a few elements and two arrays.
The results contain the following elements:
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). -
turn_road_info
- describes turn road information. The properties of turn road are:-
primary_name
-
secondary_name
Turn road contains the following field:
-
-
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.