Package com.indooratlas.android.sdk
Class IALocation
- java.lang.Object
-
- com.indooratlas.android.sdk.IALocation
-
- All Implemented Interfaces:
Parcelable,IALatLngFloorCompatible
public class IALocation extends Object implements IALatLngFloorCompatible, Parcelable
A data object representing a geographic location.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIALocation.BuilderBuilder to configureIALocation.-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Parcelable.Creator<IALocation>CREATORstatic StringEXTRA_FLOOR_CERTAINTYKey used when storing floor level information underLocation.getExtras().static StringEXTRA_FLOOR_LEVELKey used when storing floor level information underLocation.getExtras().static StringEXTRA_REGIONKey used when storing region information underLocation.getExtras().-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIALocation(Parcel in)Do not use this constructor directly.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()booleanequals(Object o)static IALocationfrom(Intent intent)Extracts anIALocationfrom the extras of anIntentornullif not present.static IALocationfrom(Location location)Convenience method to constructIALocationobject from properties in a platformlocation.floatgetAccuracy()Returns location accuracy in meters.doublegetAltitude()Returns altitude in meters, or0.0if not available.floatgetBearing()Returns bearing in degrees, in range of(0.0, 360.0].floatgetFloorCertainty()The certainty of the floor selection between 0 and 1.intgetFloorLevel()The logical floor level of building.doublegetLatitude()Returns latitude in degrees.IALatLngFloorgetLatLngFloor()doublegetLongitude()Returns longitude in degrees.IARegiongetRegion()Returns the floor plan or venue information associated with this location as anIARegion.longgetTime()Returns UTC time of this location fix.booleanhasFloorCertainty()Returnstrueif this location fix had floor certainty information.booleanhasFloorLevel()Returnstrueif this location fix had floor level information.inthashCode()IALocation.BuildernewBuilder()LocationtoLocation()Returns a platform location representing the same coordinate location asthisinstance.StringtoString()voidwriteToParcel(Parcel dest, int flags)
-
-
-
Field Detail
-
EXTRA_REGION
public static final String EXTRA_REGION
Key used when storing region information underLocation.getExtras().- See Also:
toLocation(), Constant Field Values
-
EXTRA_FLOOR_LEVEL
public static final String EXTRA_FLOOR_LEVEL
Key used when storing floor level information underLocation.getExtras().- See Also:
toLocation(), Constant Field Values
-
EXTRA_FLOOR_CERTAINTY
public static final String EXTRA_FLOOR_CERTAINTY
Key used when storing floor level information underLocation.getExtras().- See Also:
toLocation(), Constant Field Values
-
CREATOR
public static final Parcelable.Creator<IALocation> CREATOR
-
-
Constructor Detail
-
IALocation
protected IALocation(Parcel in)
Do not use this constructor directly.
-
-
Method Detail
-
newBuilder
public IALocation.Builder newBuilder()
- Returns:
IALocation.Builderpre-populated with values from thislocation.
-
from
public static IALocation from(Location location)
Convenience method to constructIALocationobject from properties in a platformlocation. The returnedIALocationcan be used e.g. withIALocationManager.setLocation(IALocation)- Returns:
- new
IALocationobject populated with values read fromlocation - See Also:
IALocationManager.setLocation(IALocation)
-
from
public static IALocation from(Intent intent)
Extracts anIALocationfrom the extras of anIntentornullif not present. Use this utility method for received Intents after requesting location updates withIALocationManager.requestLocationUpdates(IALocationRequest, PendingIntent). The location is stored in the extraBundleabyte arraywith theIALocationManager.EXTRA_LOCATIONkey.- Parameters:
intent-Intentto extract theIALocationfrom. Can be null.- Returns:
- an
IALocationornull
-
toLocation
public Location toLocation()
Returns a platform location representing the same coordinate location asthisinstance.IndoorAtlas specific attributes that the regular
Locationdoes not express, such as floor level and region are stored under extra bundle returned byLocation.getExtras(). SeeEXTRA_XXXconstants in this class.- Returns:
- new
Locationinstance representingthisobject
-
getLatitude
public double getLatitude()
Returns latitude in degrees.
-
getLongitude
public double getLongitude()
Returns longitude in degrees.
-
getBearing
public float getBearing()
Returns bearing in degrees, in range of(0.0, 360.0]. North is 0 degrees, east 90 degrees and so on.
-
getAccuracy
public float getAccuracy()
Returns location accuracy in meters.
-
getTime
public long getTime()
Returns UTC time of this location fix.
-
getAltitude
public double getAltitude()
Returns altitude in meters, or0.0if not available.
-
hasFloorLevel
public boolean hasFloorLevel()
Returnstrueif this location fix had floor level information.- See Also:
getFloorLevel(),hasFloorCertainty(),getFloorCertainty()
-
getFloorLevel
public int getFloorLevel()
The logical floor level of building. Matches the floor level of theIAFloorPlanthat this location is on. The floor levels of theIAFloorPlans are defined in the mapping phase. Returns floor level or0if no floor plan information is available at this location.- See Also:
hasFloorLevel(),hasFloorCertainty(),getFloorCertainty()
-
hasFloorCertainty
public boolean hasFloorCertainty()
Returnstrueif this location fix had floor certainty information.- See Also:
hasFloorLevel(),getFloorLevel(),getFloorCertainty()
-
getFloorCertainty
public float getFloorCertainty()
The certainty of the floor selection between 0 and 1. Returns 0 if information not available.- See Also:
hasFloorLevel(),getFloorLevel(),hasFloorCertainty()
-
getLatLngFloor
public IALatLngFloor getLatLngFloor()
- Specified by:
getLatLngFloorin interfaceIALatLngFloorCompatible
-
getRegion
public IARegion getRegion()
Returns the floor plan or venue information associated with this location as anIARegion. NOTE: if region is IAVenue, floor plan list, geofences and POIs are not included.
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcelin interfaceParcelable
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceParcelable
-
-