PAGE CONTENTS
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) | B | C | D | E | Longitude | Latitude |
|---|---|---|---|---|---|---|
| =B[n]+D[n-1] | =C[n]+E[n-1] | D[n]/100000 | E[n]/100000 | |||
| 0 | 2822974 | -2574422 | 2822974 | -2574422 | 28.22974 | -25.74422 |
| 1 | 5 | -82 | 2822979 | -2574504 | 28.22979 | -25.74504 |
| 2 | -237 | -18 | 2822742 | -2574522 | 28.22742 | -25.74522 |
| 3 | -20 | -1 | 2822722 | -2574523 | 28.22722 | -25.74523 |
| 4 | 12 | -150 | 2822734 | -2574673 | 28.22734 | -25.74673 |
| 5 | 23 | 2 | 2822757 | -2574671 | 28.22757 | -25.74671 |
| 6 | 15 | 1 | 2822772 | -2574670 | 28.22772 | -25.7467 |
| 7 | 235 | 17 | 2823007 | -2574653 | 28.23007 | -25.74653 |
| 8 | 142 | 8 | 2823149 | -2574645 | 28.23149 | -25.74645 |
| 9 | 43 | 4 | 2823192 | -2574641 | 28.23192 | -25.74641 |
| 10 | 45 | 3 | 2823237 | -2574638 | 28.23237 | -25.74638 |
| 11 | -14 | 150 | 2823223 | -2574488 | 28.23223 | -25.74488 |
| 12 | -32 | -2 | 2823191 | -2574490 | 28.23191 | -25.7449 |
| 13 | -23 | -2 | 2823168 | -2574492 | 28.23168 | -25.74492 |
| 14 | -189 | -12 | 2822979 | -2574504 | 28.22979 | -25.74504 |
| 15 | -5 | 82 | 2822974 | -2574422 | 28.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
| FeatureID | Index | TravelTime | TrafficCategory |
|---|---|---|---|
| 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 |
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 Commands | Command ID |
|---|---|
| Start | 10 |
| Turn Right | 1 |
| Turn Left | 2 |
| Keep Left | 3 |
| Keep Right | 4 |
| Sharply Left | 5 |
| Sharply Right | 6 |
| U Turn Left | 7 |
| U Turn Right | 8 |
| Keep Left and Take Highway | 11 |
| Keep Right and Take Highway | 12 |
| Keep Left and Take Exit | 13 |
| Keep Right and Take Exit | 14 |
| Turn Left and Take Highway | 15 |
| Turn Right and Take Highway | 16 |
| Take Roundabout | 19 |
| Take Nth Exit from Roundabout | 20+N |
| Destination Commands | Command ID |
|---|---|
| Destination is on the road | 30 |
| Destination is on the right | 31 |
| Destination is on the left | 32 |
| Visual Commands (Angle of deviation) | Command ID |
|---|---|
| 0-5° on both left and right sides | 50 |
| 5-15° on left side | 51 |
| 15-25° on left side | 52 |
| 25-35° on left side | 53 |
| ... for every further 10°... | ... increase by 1... |
| 165-175° on left side | 67 |
| more than 175° on left side | 68 |
| 5-15° on right side | 71 |
| 15-25° on right side | 72 |
| 25-35° on right side | 73 |
| ... for every further 10°... | ... increase by 1... |
| 165-175° on right side | 87 |
| more than 175° on right side | 88 |