LzLocation
data class LzLocation(val building: String?, var floor: String?, val polygons: List<String>? = null, var source: LocationSource = LocationSource.UNKNOWN_SOURCE) : LocationCore 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
LzLocation | constructor(jsonObject: JSONObject ) |
LzLocation | constructor(building: String ?, floor: String ?, polygons: List <String >? = null, source: LocationSource = LocationSource.UNKNOWN_SOURCE, latitude: Double , longitude: Double ) |
LzLocation | constructor(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: Booleantrue when both floor and building are non-null, indicating the user is positioned indoors with full indoor context.
polygons
val polygons: List<String>? = nullList of polygon identifiers (zones, rooms) that contain this location, or null when no polygon information is available.
source
var source: LocationSourceTypes: LocationSource
The LocationSource that produced this location (e.g., GPS, beacon, or unknown).
Functions
bearingTo
open fun bearingTo(p0: Location): FloatcompareLocationTo
fun Location.compareLocationTo(location: Location): BooleanCompares the geographic coordinates of this Location with another Location .
describeContents
open override fun describeContents(): IntdistanceTo
open fun distanceTo(p0: Location): Floatdump
open fun dump(p0: Printer, p1: String?)equals
open operator override fun equals(other: Any?): BooleanCustom equals implementation for LzLocation Compares all relevant fields including coordinates, building, floor, and source
getAccuracy
open fun getAccuracy(): FloatgetAltitude
open fun getAltitude(): DoublegetBearing
open fun getBearing(): FloatgetBearingAccuracyDegrees
open fun getBearingAccuracyDegrees(): FloatgetElapsedRealtimeAgeMillis
open fun getElapsedRealtimeAgeMillis(): Long
open fun getElapsedRealtimeAgeMillis(p0: Long): LonggetElapsedRealtimeMillis
open fun getElapsedRealtimeMillis(): LonggetElapsedRealtimeNanos
open fun getElapsedRealtimeNanos(): LonggetElapsedRealtimeUncertaintyNanos
open fun getElapsedRealtimeUncertaintyNanos(): DoublegetExtras
open fun getExtras(): Bundle?getLatitude
open fun getLatitude(): DoublegetLongitude
open fun getLongitude(): DoublegetMslAltitudeAccuracyMeters
open fun getMslAltitudeAccuracyMeters(): FloatgetMslAltitudeMeters
open fun getMslAltitudeMeters(): DoublegetProvider
open fun getProvider(): String?getSpeed
open fun getSpeed(): FloatgetSpeedAccuracyMetersPerSecond
open fun getSpeedAccuracyMetersPerSecond(): FloatgetTime
open fun getTime(): LonggetVerticalAccuracyMeters
open fun getVerticalAccuracyMeters(): FloathasAccuracy
open fun hasAccuracy(): BooleanhasAltitude
open fun hasAltitude(): BooleanhasBearing
open fun hasBearing(): BooleanhasBearingAccuracy
open fun hasBearingAccuracy(): BooleanhasElapsedRealtimeUncertaintyNanos
open fun hasElapsedRealtimeUncertaintyNanos(): BooleanhashCode
open override fun hashCode(): IntCustom hashCode implementation for LzLocation Must be consistent with equals()
hasMslAltitude
open fun hasMslAltitude(): BooleanhasMslAltitudeAccuracy
open fun hasMslAltitudeAccuracy(): BooleanhasSpeed
open fun hasSpeed(): BooleanhasSpeedAccuracy
open fun hasSpeedAccuracy(): BooleanhasVerticalAccuracy
open fun hasVerticalAccuracy(): BooleanisComplete
open fun isComplete(): BooleanisFromMockProvider
open fun isFromMockProvider(): BooleanisMock
open fun isMock(): BooleanreachableFrom
fun reachableFrom(location: Location): BooleanChecks 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(): JSObjecttoLzLocation
fun Location.toLzLocation(building: String? = null, floor: String? = null, source: LocationSource = LocationSource.UNKNOWN_SOURCE): LzLocationTypes: LocationSource
Converts an Android Location into an LzLocation, preserving all original location properties and attaching optional indoor context.
toString
open override fun toString(): StringwriteToParcel
open override fun writeToParcel(p0: Parcel, p1: Int)