Skip to Content

LzLocation

data class LzLocation(val building: String?, var floor: String?, val polygons: List<String>? = null, var source: LocationSource = LocationSource.UNKNOWN_SOURCE) : Location

Core location model for the Lazarillo SDK, extending Android’s Location  to add indoor context such as building, floor, and polygon identifiers.

Unlike a plain Location , an LzLocation carries indoor positioning metadata that enables the SDK to distinguish between locations on different floors or within different buildings. This distinction is critical for routing: two points with identical latitude/longitude but on different floors are treated as far apart so the router can detect off-route situations and trigger re-routing.

Instances are produced by LocationMergedRepository, which fuses GPS and beacon data sources. When beacon data is available the location is tagged with building/floor information, making isIndoor return true.

See also

LocationSource
LocationMergedRepository
toLzLocation

Constructors

LzLocationconstructor(jsonObject: JSONObject )
LzLocationconstructor(building: String ?, floor: String ?, polygons: List <String >? = null, source: LocationSource = LocationSource.UNKNOWN_SOURCE, latitude: Double , longitude: Double )
LzLocationconstructor(building: String ?, floor: String ?, polygons: List <String >? = null, source: LocationSource = LocationSource.UNKNOWN_SOURCE)

Properties

building

val building: String?

Identifier of the building this location belongs to, or null when outdoors.

floor

var floor: String?

Identifier of the floor within the building, or null when outdoors or floor is unknown. Together with building, this affects distance calculations so that different vertical levels are not considered equivalent positions.

isIndoor

val isIndoor: Boolean

true when both floor and building are non-null, indicating the user is positioned indoors with full indoor context.

polygons

val polygons: List<String>? = null

List of polygon identifiers (zones, rooms) that contain this location, or null when no polygon information is available.

source

var source: LocationSource

Types: LocationSource

The LocationSource that produced this location (e.g., GPS, beacon, or unknown).

Functions

bearingTo

open fun bearingTo(p0: Location): Float

compareLocationTo

fun Location.compareLocationTo(location: Location): Boolean

Compares the geographic coordinates of this Location  with another Location .

describeContents

open override fun describeContents(): Int

distanceTo

open fun distanceTo(p0: Location): Float

dump

open fun dump(p0: Printer, p1: String?)

equals

open operator override fun equals(other: Any?): Boolean

Custom equals implementation for LzLocation Compares all relevant fields including coordinates, building, floor, and source

getAccuracy

open fun getAccuracy(): Float

getAltitude

open fun getAltitude(): Double

getBearing

open fun getBearing(): Float

getBearingAccuracyDegrees

open fun getBearingAccuracyDegrees(): Float

getElapsedRealtimeAgeMillis

open fun getElapsedRealtimeAgeMillis(): Long open fun getElapsedRealtimeAgeMillis(p0: Long): Long

getElapsedRealtimeMillis

open fun getElapsedRealtimeMillis(): Long

getElapsedRealtimeNanos

open fun getElapsedRealtimeNanos(): Long

getElapsedRealtimeUncertaintyNanos

open fun getElapsedRealtimeUncertaintyNanos(): Double

getExtras

open fun getExtras(): Bundle?

getLatitude

open fun getLatitude(): Double

getLongitude

open fun getLongitude(): Double

getMslAltitudeAccuracyMeters

open fun getMslAltitudeAccuracyMeters(): Float

getMslAltitudeMeters

open fun getMslAltitudeMeters(): Double

getProvider

open fun getProvider(): String?

getSpeed

open fun getSpeed(): Float

getSpeedAccuracyMetersPerSecond

open fun getSpeedAccuracyMetersPerSecond(): Float

getTime

open fun getTime(): Long

getVerticalAccuracyMeters

open fun getVerticalAccuracyMeters(): Float

hasAccuracy

open fun hasAccuracy(): Boolean

hasAltitude

open fun hasAltitude(): Boolean

hasBearing

open fun hasBearing(): Boolean

hasBearingAccuracy

open fun hasBearingAccuracy(): Boolean

hasElapsedRealtimeUncertaintyNanos

open fun hasElapsedRealtimeUncertaintyNanos(): Boolean

hashCode

open override fun hashCode(): Int

Custom hashCode implementation for LzLocation Must be consistent with equals()

hasMslAltitude

open fun hasMslAltitude(): Boolean

hasMslAltitudeAccuracy

open fun hasMslAltitudeAccuracy(): Boolean

hasSpeed

open fun hasSpeed(): Boolean

hasSpeedAccuracy

open fun hasSpeedAccuracy(): Boolean

hasVerticalAccuracy

open fun hasVerticalAccuracy(): Boolean

isComplete

open fun isComplete(): Boolean

isFromMockProvider

open fun isFromMockProvider(): Boolean

isMock

open fun isMock(): Boolean

reachableFrom

fun reachableFrom(location: Location): Boolean

Checks whether this location is reachable from the given location without a floor or building transition.

removeAccuracy

open fun removeAccuracy()

removeAltitude

open fun removeAltitude()

removeBearing

open fun removeBearing()

removeBearingAccuracy

open fun removeBearingAccuracy()

removeElapsedRealtimeUncertaintyNanos

open fun removeElapsedRealtimeUncertaintyNanos()

removeMslAltitude

open fun removeMslAltitude()

removeMslAltitudeAccuracy

open fun removeMslAltitudeAccuracy()

removeSpeed

open fun removeSpeed()

removeSpeedAccuracy

open fun removeSpeedAccuracy()

removeVerticalAccuracy

open fun removeVerticalAccuracy()

reset

open fun reset()

set

open fun set(p0: Location)

setAccuracy

open fun setAccuracy(p0: Float)

setAltitude

open fun setAltitude(p0: Double)

setBearing

open fun setBearing(p0: Float)

setBearingAccuracyDegrees

open fun setBearingAccuracyDegrees(p0: Float)

setElapsedRealtimeNanos

open fun setElapsedRealtimeNanos(p0: Long)

setElapsedRealtimeUncertaintyNanos

open fun setElapsedRealtimeUncertaintyNanos(p0: Double)

setExtras

open fun setExtras(p0: Bundle?)

setLatitude

open fun setLatitude(p0: Double)

setLongitude

open fun setLongitude(p0: Double)

setMock

open fun setMock(p0: Boolean)

setMslAltitudeAccuracyMeters

open fun setMslAltitudeAccuracyMeters(p0: Float)

setMslAltitudeMeters

open fun setMslAltitudeMeters(p0: Double)

setProvider

open fun setProvider(p0: String?)

setSpeed

open fun setSpeed(p0: Float)

setSpeedAccuracyMetersPerSecond

open fun setSpeedAccuracyMetersPerSecond(p0: Float)

setTime

open fun setTime(p0: Long)

setVerticalAccuracyMeters

open fun setVerticalAccuracyMeters(p0: Float)

toJSObject

fun Location.toJSObject(): JSObject

toLzLocation

fun Location.toLzLocation(building: String? = null, floor: String? = null, source: LocationSource = LocationSource.UNKNOWN_SOURCE): LzLocation

Types: LocationSource

Converts an Android Location  into an LzLocation, preserving all original location properties and attaching optional indoor context.

toString

open override fun toString(): String

writeToParcel

open override fun writeToParcel(p0: Parcel, p1: Int)
Last updated on