KNLocation
INFO
This English reference is based on Directions SDK with UI 1.12.8-hotfix02 (as of 2026-07-24). For the latest version, see the Korean reference.
Provides location information along the route. It can also reflect information such as traffic conditions and facility types in route guidance.
Example code — KNLocation
class KNLocationConstructor
Example code — Initialization
// <init>
KNLocation(pos: FloatPoint, route: KNRoute?, distFromS: Int, linkIdx: Int, polyIdx: Int)Properties
| Name | Description | Type |
|---|---|---|
pos | Position coordinates along the route (uses the KATEC coordinate system) | val pos: FloatPoint |
roadName | Name of the road currently on along the route (if there is no road name: null ) | var roadName: String? |
roadType | Type of the road currently on along the route | var roadType: KNRoadType |
facilityType | Traffic facility currently on along the route | var facilityType: KNFacilityType |
trafficSt | Traffic conditions of the road currently on along the route | var trafficSt: KNTrafficState |
trafficSpd | Driving speed information of the road currently on along the route (unit: km/h). Driving speed, also called section speed, indicates the average speed in the current section. This speed may vary depending on factors such as weather, time, and traffic volume. | var trafficSpd: Int |
Methods
avrTrafStToLocation
Provides the traffic conditions and average speed from the current location to the destination. The average speed is a combination of the average of the traffic condition states and speeds of the two points.
fun avrTrafStToLocation(location: KNLocation): IntParameters
| Name | Description |
|---|---|
location | Destination |
costToLocation
Returns the fee from the current location to the destination (unit: KRW).
fun costToLocation(location: KNLocation): IntParameters
| Name | Description |
|---|---|
location | Destination |
distToLocation
Returns the distance from the current location to the destination (unit: m).
fun distToLocation(location: KNLocation): IntParameters
| Name | Description |
|---|---|
location | Destination |
locationAfterDist
Returns a location that is a specific distance away along the route.
fun locationAfterDist(dist: Int): KNLocation?Parameters
| Name | Description |
|---|---|
dist | Distance away |
timeToLocation
Returns the time from the current location to the destination (unit: seconds).
fun timeToLocation(location: KNLocation): IntParameters
| Name | Description |
|---|---|
location | Destination |
isSameToLocation
Compares the location information of two objects to determine whether the location information and details are identical.
fun isSameToLocation(location: KNLocation): BooleanParameters
| Name | Description |
|---|---|
location | Location to compare |