KNRoute
INFO
This English reference is based on Directions SDK 1.12.8-hotfix02. For the latest version, see the Korean reference.
Provides route options such as recommended route, normal roads, and highways.
Example code — KNRoute
class KNRouteConstructor
Example code — Initialization
// <init>
KNRoute(priority: KNRoutePriority, avoidOptions: Int, drkey: String?, networkVersion: Int, desc: String?, isDestinationOnLeftSide: Boolean, hasTheOtherSideRoute: Boolean, data: ByteArray, reqPoint: IntPoint)
KNRoute(priority: KNRoutePriority, avoidOptions: Int, drkey: String?, error: KNError?, desc: String?, roadEvent: JSONObject?)Properties
| Name | Description | Type |
|---|---|---|
priority | Item to prioritize among the route guidance options | var priority: KNRoutePriority? |
avoidOptions | Sections to avoid in the route | var avoidOptions: Int |
drkey | Unique route number | var drkey: String? |
desc | Route characteristics | var desc: String? |
isDestinationOnLeftSide | Position of the destination along the route. true : on the left, false : on the right (default: false ) | var isDestinationOnLeftSide: Boolean |
hasTheOtherSideRoute | Whether a route on the opposite side of the destination exists. Does not work on ordinary two-way roads. true : opposite-side route exists, false : no opposite-side route (default: false ) | var hasTheOtherSideRoute: Boolean |
totalDist | Total distance of the route (unit: m) | var totalDist: Int |
totalTime | Total estimated time of the route (unit: seconds) | var totalTime: Int |
totalCost | Total fee of the route (unit: KRW) | var totalCost: Int |
containsFerryRoute | Whether the route includes a ferry route. true : includes a ferry route, false : does not include a ferry route (default: false ) | var containsFerryRoute: Boolean |
locationsOfPois | List of waypoint locations in the route | var locationsOfPois: MutableMap<String, KNLocation>? |
Methods
aroundInfoList
Returns a list of surrounding information in the route.
TIP
Currently, only gas station information is provided.
fun aroundInfoList(): List<KNAroundInfo>?containsSafetyZone
Returns whether the route includes a protected zone.
fun containsSafetyZone( safetyZoneType: KNSafetyZoneType ): BooleanParameters
| Name | Description |
|---|---|
safetyZoneType | Protected zone type |
highwayRGList
Returns a list of highway information in the route.
fun highwayRGList(): List<List<KNHighwayRG>>?locationOnRoute
Checks the current location on the route being driven. Can be used to check the entire route or to calculate the remaining distance.
fun locationOnRoute( location: KNLocation ): KNLocationParameters
| Name | Description |
|---|---|
location | Reference location |
mainDirectionList
Returns a list of the main turn sections in the route.
fun mainDirectionList(): List<KNDirection>mainFacilityList
Returns a list of the main traffic facility sections in the route.
fun mainFacilityList(): List<KNRoadInfo_Facility>?mainRoadList
Returns a list of the main road sections in the route.
fun mainRoadList(): List<KNRoadInfo_Road>?remainCostFromLocation
Returns the remaining fee to a specific location during route guidance (unit: KRW).
fun remainCostFromLocation( location: KNLocation ): IntParameters
| Name | Description |
|---|---|
location | Reference location |
remainDistFromLocation
Returns the remaining distance to a specific location during route guidance (unit: m).
fun remainDistFromLocation( location: KNLocation ): IntParameters
| Name | Description |
|---|---|
location | Reference location |
remainTimeFromLocation
Displays the remaining time to a specific location during route guidance (unit: seconds).
fun remainTimeFromLocation( location: KNLocation ): IntParameters
| Name | Description |
|---|---|
location | Reference location |
roadEventList
Returns a list of traffic incident information in the route.
fun roadEventList(): List<KNRoadEvent>?routePolylineWGS84
Converts the linear route coordinates in the KATEC coordinate system to the WGS84 coordinate system and returns them.
fun routePolylineWGS84(): List<Map<String Number>>?safetyList
Returns a list of safe driving information in the route.
fun safetyList(): List<KNSafety>?safetyZoneList
Returns a list of protected zone sections in the route.
fun safetyZoneList(): List<KNSafetyZone>?