GetNavigationRouteAG response details

These 3 sections explain the details of each part of the GetNavigationRouteAG response, in more depth than can be covered in the API specification.

GetNavigationRouteAG Response Details

1. RoutePoints Details

RoutePoints is a list of compressed coordinates for drawing the route on a map or navigation screen. The number of points is given by TotalPoint. Indices in the related FeatureLists or CommandLists objects refer to this list of points – take note that the index is zero-based.

The Points are listed in a compressed format to reduce the size of the response. All coordinates are multiplied by 100 000 and truncated to an integer (this is approximately 10 cm accuracy). The starting longitude and latitude is given, followed by the difference (or delta) from the previous coordinate, repeated to the end of the list.

Conversion example:

2822974, -2574422, 5, -82, -237, -18, -20, -1, 12, -150, 23, 2, 15, 1, 235, 17, 142, 8, 43, 4, 45, 3, -14, 150, -32, -2, -23, -2, -189, -12, -5, 82

Index
(Zero based)
BCDELongitudeLatitude
=B[n]+D[n-1]=C[n]+E[n-1]D[n]/100000E[n]/100000
02822974-25744222822974-257442228.22974-25.74422
15-822822979-257450428.22979-25.74504
2-237-182822742-257452228.22742-25.74522
3-20-12822722-257452328.22722-25.74523
412-1502822734-257467328.22734-25.74673
52322822757-257467128.22757-25.74671
61512822772-257467028.22772-25.7467
7235172823007-257465328.23007-25.74653
814282823149-257464528.23149-25.74645
94342823192-257464128.23192-25.74641
104532823237-257463828.23237-25.74638
11-141502823223-257448828.23223-25.74488
12-32-22823191-257449028.23191-25.7449
13-23-22823168-257449228.23168-25.74492
14-189-122822979-257450428.22979-25.74504
15-5822822974-257442228.22974-25.74422

2. FeatureLists Details

While RoutePoints shows every twist and turn on a route (and there can be many on a single street segment), FeatureLists works at the level higher – for each different street segment. It is a comma-separated list containing the street ID, the starting index (refer to RoutePoints) and the travel time for that street segment. The total number of features (street segments) is given by TotalFeature. Format: ID1,Index1,TravelTime1,TrafficCategory1, ID2,Index2,TravelTime2,TrafficCategory2, … where:

  • ID – the unique AfriGIS FeatureID, mostly commonly AG_STR_ID.
  • Index – the index position of this feature’s starting coordinate, in the list of RoutePoints.
  • TravelTime – the time (in minutes) to traverse the entire feature.

Example:

164885,0,0.220341,undefined, 164469,1,0.477737,3_congested, 164651,3,0.432173,undefined, 164496,4,0.078686,1_freeflowing, 164496,6,0.507153,1_freeflowing, 164496,9,0.0551543,1_freeflowing, 164883,10,0.432293,undefined, 164882,11,0.0724996,1_freeflowing, 164882,12,0.255014,1_freeflowing, 164885,13,0.387007,undefined

FeatureIDIndexTravelTimeTrafficCategory
16488500.220341
undefined
16446910.477737
3_congested
16465130.432173
undefined
16449640.078686
1_freeflowing
16449660.507153
1_freeflowing
16449690.0551543
1_freeflowing
164883100.432293
undefined
164882110.0724996
1_freeflowing
164882120.255014
1_freeflowing
164885130.387007
undefined

3. CommandLists Details

Not every street segment requires an audible or visual navigation command (for example, to continue straight.) The CommandLists object lists all the voice (audible) or visual navigation commands to present to a user while he is navigating. Most commands have an index (referring to the RoutePoints list) where the command should be presented, and voice commands also include the name and length of the street segment.

There are three types of navigation commands:

  • Voice Commands – indicates what voice command to play at this location, as well as the street name and the length of the street segment.
  • Destination Command – indicates that this is the last command on a route.
  • Visual Commands – additional visual cues to guide the user visually at this location, such as a 20° turn to the left.

Voice command format

A comma-separated list of commandID,Index,Name,Length where:

  • commandID – an instruction in the CommandID lookup table. (See below)
  • Index – the index position of this command’s starting coordinate, in the list of RoutePoints.
  • Name – name of the street segment.
  • Length – length of the street segment (in km).

Destination command format

The destination command only contains the destination commandID.

Visual command format

The visual command only contains the commandID and Index.

Example

The example below contains a list of commands. Voice command in green, Destination command in blue, and Visual commands in red.

10, 0, Athlone Street, 0.0910037, 1, 1, Pretorius Street, 0.259222, 2, 3, Hill Street, 0.166184, 2, 4, Schoeman Street, 0.121007, 50, 6, 50, 9, 2, 10, Festival Street, 0.166234, 2, 11, Pretorius Street, 0.253813, 50, 12, 50, 13, 1, 14, Athlone Street, 0.0910037, 32

Voice CommandsCommand ID
Start10
Turn Right1
Turn Left2
Keep Left3
Keep Right4
Sharply Left5
Sharply Right6
U Turn Left7
U Turn Right8
Keep Left and Take Highway11
Keep Right and Take Highway12
Keep Left and Take Exit13
Keep Right and Take Exit14
Turn Left and Take Highway15
Turn Right and Take Highway16
Take Roundabout19
Take Nth Exit from Roundabout20+N

Destination CommandsCommand ID
Destination is on the road30
Destination is on the right31
Destination is on the left32

Visual Commands
(Angle of deviation)
Command ID
0-5° on both left and right sides50
5-15° on left side51
15-25° on left side52
25-35° on left side53
... for every further 10°...... increase by 1...
165-175° on left side67
more than 175° on left side68
5-15° on right side71
15-25° on right side72
25-35° on right side73
... for every further 10°...... increase by 1...
165-175° on right side87
more than 175° on right side88