Package es.situm.sdk.model.location
Class Location
- java.lang.Object
-
- es.situm.sdk.model.location.Location
-
- All Implemented Interfaces:
android.os.Parcelable
,BuildingResource
,FloorResource
public class Location extends Object implements FloorResource, android.os.Parcelable
A location. It can be indoor or outdoor, checkisIndoor()
andisOutdoor()
. A valid indoor location has floorIdentifier and cartesianCoordinate.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Location.Builder
static class
Location.Quality
The quality of the location/bearing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
boolean
equals(Object o)
float
getAccuracy()
Return the accuracy radius (in meters)Angle
getBearing()
Return the bearing (in degrees) with respect to the Earth North.Location.Quality
getBearingQuality()
Return the quality of the cartesian bearing.String
getBuildingIdentifier()
Only used in indoor.Angle
getCartesianBearing()
Only used in indoor.CartesianCoordinate
getCartesianCoordinate()
Only used in indoor.Coordinate
getCoordinate()
Return the coordinate of the locationMap<String,String>
getCustomFields()
Returns map of custom fields, indexed by their name.String
getDeviceId()
Returns the device identifier that has generated the locationString
getFloorIdentifier()
Only used in indoor.Point
getPosition()
Return the position of the location.String
getProvider()
Location.Quality
getQuality()
Only used in indoor.long
getTime()
Return the timestamp of the location.boolean
hasBearing()
Return true if the location has bearing and the bearing quality isLocation.Quality.HIGH
, false otherwise.boolean
hasCartesianBearing()
Only used in indoor.int
hashCode()
boolean
isIndoor()
Return true if the location is indoorboolean
isOutdoor()
Return true if the location is outdoorString
toString()
void
writeToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<Location> CREATOR
-
-
Method Detail
-
getPosition
public Point getPosition()
Return the position of the location. Only needed if you neede access to the internalPoint
object. It's better to use directlygetCoordinate()
,getCartesianCoordinate()
, etc. on theLocation
object
-
isIndoor
public boolean isIndoor()
Return true if the location is indoor- See Also:
isOutdoor()
-
getDeviceId
public String getDeviceId()
Returns the device identifier that has generated the location
-
isOutdoor
public boolean isOutdoor()
Return true if the location is outdoor- See Also:
isIndoor()
-
getCoordinate
public Coordinate getCoordinate()
Return the coordinate of the location
-
getCartesianCoordinate
public CartesianCoordinate getCartesianCoordinate()
Only used in indoor. Return the cartesian coordinate in the corresponding floor of the building image.
-
getBuildingIdentifier
public String getBuildingIdentifier()
Only used in indoor. Return the building identifier.- Specified by:
getBuildingIdentifier
in interfaceBuildingResource
-
getFloorIdentifier
public String getFloorIdentifier()
Only used in indoor. Return the floor identifier.- Specified by:
getFloorIdentifier
in interfaceFloorResource
-
getQuality
public Location.Quality getQuality()
Only used in indoor. Return an indicative of quality calculated with accuracy and building size.
-
getTime
public long getTime()
Return the timestamp of the location.
-
getAccuracy
public float getAccuracy()
Return the accuracy radius (in meters)
-
hasCartesianBearing
public boolean hasCartesianBearing()
Only used in indoor. Return true if the location has cartesian bearing and the bearing quality isLocation.Quality.HIGH
, false otherwise.- See Also:
getCartesianBearing()
,getBearingQuality()
-
getCartesianBearing
public Angle getCartesianBearing()
Only used in indoor. Return the bearing with respect to the building, being 0 the west-east axis. IfhasCartesianBearing()
is false the bearing returned couldn't be reliable. You can get the bearing quality withgetBearingQuality()
-
hasBearing
public boolean hasBearing()
Return true if the location has bearing and the bearing quality isLocation.Quality.HIGH
, false otherwise.- See Also:
getBearing()
,getBearingQuality()
-
getBearing
public Angle getBearing()
Return the bearing (in degrees) with respect to the Earth North. IfhasBearing()
is false it will return a default Angle
-
getProvider
public String getProvider()
-
getBearingQuality
public Location.Quality getBearingQuality()
Return the quality of the cartesian bearing. It's recommended to use the value of the bearing only if the quality isLocation.Quality.HIGH
. If the quality isLocation.Quality.LOW
the bearing is not reliable. If the location is outdoor and the bearing is set the quality will beLocation.Quality.HIGH
-
getCustomFields
public Map<String,String> getCustomFields()
Returns map of custom fields, indexed by their name.
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-