Automobile Routing
Service Introduction
Plan an eligible driving route plan based on the starting and ending coordinates.
Interface address
https://lbs.navinfo.com/open-api/direction/v1/driving
Request method
GET
Request parameters
[Drive Navigation Service] request parameter description please refer to the following table:
Parameter | Type | Meaning | Required | Default | Remarks |
---|---|---|---|---|---|
ak | string | Developer Key | Yes | My AK | If there is no key, please apply |
guid | string | device id | No | ||
orig | string | starting latitude and longitude | Yes | Example: 116.30815, 40.056878 | |
dest | string | End point latitude and longitude | Yes | Example: 116.30815, 40.056878 | |
mid | string | Point coordinate string | No | Format: lon1, Lat1;lon2,lat2;......, support up to 12 | |
inGb | string | Enter the coordinate system corresponding to the coordinates | No | g02 | Default: g02, |
outGb | string | The coordinate system corresponding to the output coordinates | No | g02 | Default: g02, |
policy | int | driving strategy | No | 0 | 0: default (road condition + time + mileage comprehensive consideration) |
num | int | Return the number of recommended routes | No | 1 | Value range: 1<=num<=3. If you enter a number, it will return the corresponding number of digits. For example, if you enter 2, you will return 2 lines. |
stime | string | Departure time | No | Current time | Beijing time |
gpsdir | int | The head direction of the starting point | No | The direction of the front In order to form an angle with the north direction, this parameter is used to assist in judging the forward and reverse lanes where the starting point is located. This direction is adopted when sp>1.5 m/s and gpsdir is present. Gpsdir does not mean that you need to fill in the direction obtained from gps, you can fill in the corrected direction. | |
radius | int | Location accuracy of the starting point | No | With gpsdir Field Usage | |
sp | double | The speed of the starting vehicle | No | Use with the gpsdir field. When sp>1.5m/s and gpsdir exists, use the direction of gpsdir. | |
adpy | string | Rescue area | No | Support 32 avoidances Areas, each area can have up to 16 vertices, and the coordinate points are separated by ";", and the areas are separated by "|". If it is a quadrilateral, there are four coordinate points, and if it is a pentagon, there are five coordinate points; the avoidance area cannot exceed 81 square kilometers, otherwise the avoidance area will fail. | |
adroad | string | Avoid road names | No | Multiple Road, use; separation, example: Beiqing Road; Yongfeng Road | |
pnum | string | License plate number used to determine whether to limit the line | No | Do not fill in the limit line issue, support 7 traditional license plates, |
Response data
Please refer to the following table for the return parameter description of [Driving Calculation Service]:
Return Value | Type | Meaning | Required | Remarks | ||||
---|---|---|---|---|---|---|---|---|
status | int | return status | Yes | See status code table for details. | ||||
msg | string | return status description | Yes | See status code table for details. | ||||
data | object | Back Driving path planning information | Yes | |||||
orig | string | Starting Point Coordinates | Yes | |||||
dest | string | Endpoint Coordinates | Yes | |||||
total | int | number of programs | Yes | |||||
Routes | array | drive transfer plan | Yes | |||||
rid | int | The first path planning scheme | Yes | |||||
dis | int | Travel Distance | Yes | Unit: Meter | ||||
dur | int | Expected line time | Yes | Unit: Second | ||||
rtoll | int | Toll fee | Yes | Unit: Yuan | ||||
tlights | int | Number of traffic lights | Yes | Unit: Second | ||||
nms | string | The name of the road that has passed by driving | Yes | Between road names, separated by numbers | ||||
restr | int | Limited Results | Yes | 0: Represents that the limit line has been circumvented or unrestricted, that is, the route has no restricted road section. <1> Represents the limit line without circumvention, that is, the limited line section of the line (for the license plate limit line field) | ||||
steps | array | Driving Route segmentation | Yes | |||||
sid | int | The first sub-sections | No | |||||
legid | int | path point number | No | The route point number is an integer starting from 0, which is used to identify the route point to which the step belongs. Step belongs to the road segment from the starting point to the first route, then its legid is 0 | ||||
rinfo | string | Travel Description | No | For example: "Take southwest for 44 meters and turn right into the main road" | ||||
nm | string | Road Name | No | |||||
dis | int | This distance is | No | |||||
lonlats | string | This Link latitude and longitude string | No | The coordinate point string of this road segment, in the format, such as: 116.481247, 39.990704; 116.481270, 39.990726 | ||||
ttype | string | Trending direction | No | Example: “Turn right front, go straight”, see Shift Action List | ||||
tmc | array | Segmented traffic details | No | |||||
status | int | road condition index | No | 0 No road condition; 1 unblocked; 2 slow; 3 congested; 4 very congested | ||||
dis | int | the length of this section | No | Unit: Meter | ||||
ilonlat | string | The latitude and longitude of this section | No | The format is: x, y, the value is lonlat. The starting and ending index of the array is separated by semicolon. Example: 1,7 |
Steering Action List:
List of main actions | |
---|---|
Go straight | Left |
Right turn | Left front |
Right front | Left rear |
Right rear | Keep left |
Keep right | Go straight and lean left |
Go straight and turn right | Left turn left and left |
Left turn and right | turn right and lean left |
turn right and lean right | Tune |
Service example