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 class
IALocation.Builder
Builder 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>
CREATOR
static String
EXTRA_FLOOR_CERTAINTY
Key used when storing floor level information underLocation.getExtras()
.static String
EXTRA_FLOOR_LEVEL
Key used when storing floor level information underLocation.getExtras()
.static String
EXTRA_REGION
Key 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 protected
IALocation(Parcel in)
Do not use this constructor directly.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
boolean
equals(Object o)
static IALocation
from(Intent intent)
Extracts anIALocation
from the extras of anIntent
ornull
if not present.static IALocation
from(Location location)
Convenience method to constructIALocation
object from properties in a platformlocation
.float
getAccuracy()
Returns location accuracy in meters.double
getAltitude()
Returns altitude in meters, or0.0
if not available.float
getBearing()
Returns bearing in degrees, in range of(0.0, 360.0]
.float
getFloorCertainty()
The certainty of the floor selection between 0 and 1.int
getFloorLevel()
The logical floor level of building.double
getLatitude()
Returns latitude in degrees.IALatLngFloor
getLatLngFloor()
double
getLongitude()
Returns longitude in degrees.IARegion
getRegion()
Returns the floor plan information associated with this location as anIARegion
.long
getTime()
Returns UTC time of this location fix.boolean
hasFloorCertainty()
Returnstrue
if this location fix had floor certainty information.boolean
hasFloorLevel()
Returnstrue
if this location fix had floor level information.int
hashCode()
IALocation.Builder
newBuilder()
Location
toLocation()
Returns a platform location representing the same coordinate location asthis
instance.String
toString()
void
writeToParcel(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.Builder
pre-populated with values from thislocation
.
-
from
public static IALocation from(Location location)
Convenience method to constructIALocation
object from properties in a platformlocation
. The returnedIALocation
can be used e.g. withIALocationManager.setLocation(IALocation)
- Returns:
- new
IALocation
object populated with values read fromlocation
- See Also:
IALocationManager.setLocation(IALocation)
-
from
public static IALocation from(Intent intent)
Extracts anIALocation
from the extras of anIntent
ornull
if not present. Use this utility method for received Intents after requesting location updates withIALocationManager.requestLocationUpdates(IALocationRequest, PendingIntent)
. The location is stored in the extraBundle
abyte array
with theIALocationManager.EXTRA_LOCATION
key.- Parameters:
intent
-Intent
to extract theIALocation
from. Can be null.- Returns:
- an
IALocation
ornull
-
toLocation
public Location toLocation()
Returns a platform location representing the same coordinate location asthis
instance.IndoorAtlas specific attributes that the regular
Location
does not express, such as floor level and region are stored under extra bundle returned byLocation.getExtras()
. SeeEXTRA_XXX
constants in this class.- Returns:
- new
Location
instance representingthis
object
-
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.0
if not available.
-
hasFloorLevel
public boolean hasFloorLevel()
Returnstrue
if 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 theIAFloorPlan
that this location is on. The floor levels of theIAFloorPlan
s are defined in the mapping phase. Returns floor level or0
if no floor plan information is available at this location.- See Also:
hasFloorLevel()
,hasFloorCertainty()
,getFloorCertainty()
-
hasFloorCertainty
public boolean hasFloorCertainty()
Returnstrue
if 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:
getLatLngFloor
in interfaceIALatLngFloorCompatible
-
getRegion
public IARegion getRegion()
Returns the floor plan information associated with this location as anIARegion
.
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceParcelable
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceParcelable
-
-