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
,MapperInterface
public class Location extends java.lang.Object implements FloorResource, android.os.Parcelable, MapperInterface
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.
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<Location>
CREATOR
-
Fields inherited from interface es.situm.sdk.model.MapperInterface
ACCESSIBILITY_MODE, ACCURACY, ADDRESS, ALTITUDE, BEARING, BEARING_FROM, BEARING_QUALITY, BOUNDS, BOUNDS_ROTATED, BUILDING, BUILDING_IDENTIFIER, BUILDING_NAME, CARTESIAN_BEARING, CARTESIAN_COORDINATE, CENTER, CLOSEST_LOCATION_IN_ROUTE, CODE, CONVERSION, COORDINATE, CREATED_AT, CURRENT_INDICATION, CURRENT_STEP_INDEX, CUSTOM_FIELDS, dateFormat, DEGREES, DEGREES_CLOCKWISE, DEVICE_ID, DIAGNOSTICS_OPTIONS_UPLOAD_DIAGNOSTICS_DATA, DIMENSIONS, DISTANCE, DISTANCE_TO_CHANGE_FLOOR_THRESHOLD, DISTANCE_TO_CHANGE_INDICATION_THRESHOLD, DISTANCE_TO_CLOSEST_POINT_IN_ROUTE, DISTANCE_TO_END_STEP, DISTANCE_TO_GOAL, DISTANCE_TO_GOAL_THRESHOLD, DISTANCE_TO_IGNORE_FIRST_INDICATION, DISTANCE_TO_NEXT_LEVEL, EDGES, EVENTS, EXCLUDED_TAGS, EXTERNAL_NAVIGATION_PAYLOAD, EXTERNAL_NAVIGATION_TYPE, FIRST_STEP, FLOOR, FLOOR_IDENTIFIER, FLOORS, FOREGROUND_SERVICE_NOTIFICATION_MESSAGE, FOREGROUND_SERVICE_NOTIFICATION_SHOW_STOP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_STOP_ACTION_TEXT, FOREGROUND_SERVICE_NOTIFICATION_TAP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_TITLE, FROM, GEOFENCES, HAS_BEARING, HAS_CARTESIAN_BEARING, HEIGHT, HUMAN_READABLE_MESSAGE, ID, IDENTIFIER, IGNORE_LOW_QUALITY_LOCATIONS, INCLUDED_TAGS, INDICATION_TYPE, INDICATIONS, INDICATIONS_INTERVAL, INDOOR_POIS, INFO_HTML, IS_FIRST, IS_INDOOR, IS_LAST, IS_OUTDOOR, IS_PUBLIC, LAST_STEP, LATITUDE, LONGITUDE, MAP_URL, MINIMIZE_FLOOR_CHANGES, NAME, NEEDED_LEVEL_CHANGE, NEXT_INDICATION, NEXT_LEVEL, NODES, NORTH_EAST, NORTH_WEST, ORIENTATION, ORIENTATION_TYPE, OUTDOOR_BUILDING_DETECTOR_BLE, OUTDOOR_POIS, OUTSIDE_ROUTE_THRESHOLD, PICTURE_THUMB_URL, PICTURE_URL, POI_CATEGORIES, POI_CATEGORY, POI_CATEGORY_CODE, POI_CATEGORY_ICON_SELECTED, POI_CATEGORY_ICON_UNSELECTED, POI_CATEGORY_IDENTIFIER, POI_CATEGORY_IDENTIFIERS, POI_CATEGORY_iNAME, POI_CATEGORY_NAME, POI_NAME, POI_TO, POI_TO_IDENTIFIER, POINTS, POLYGON_POINTS, POSITION, PROVIDER, QUALITY, RADIANS, RADIANS_MINUS_PI_PI, RADIUS, ROTATION, ROUND_INDICATIONS_STEP, ROUTE, ROUTE_STEP, SCALE, SEGMENTS, SOUTH_EAST, SOUTH_WEST, STATUS_NAME, STATUS_ORDINAL, STEP_IDX_DESTINATION, STEP_IDX_ORIGIN, STEPS, TIME_TO_END_STEP, TIME_TO_FIRST_INDICATION, TIME_TO_GOAL, TIME_TO_IGNORE_UNEXPECTED_FLOOR_CHANGES, TIMESTAMP, TO, TO_LEGACY, TRIGGER, UPDATED_AT, USER_IDENTIFIER, WIDTH, X, Y
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
boolean
equals(java.lang.Object o)
static Location
fromMap(java.util.Map<java.lang.String,java.lang.Object> map)
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.java.lang.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 locationjava.util.Map<java.lang.String,java.lang.String>
getCustomFields()
Returns map of custom fields, indexed by their name.java.lang.String
getDeviceId()
Returns the device identifier that has generated the locationjava.lang.String
getFloorIdentifier()
Only used in indoor.Angle
getPitch()
Only used in indoor.Point
getPosition()
Return the position of the location.java.lang.String
getProvider()
Location.Quality
getQuality()
Only used in indoor.Angle
getRoll()
Only used in indoor.float[]
getRotationMatrix()
Return the rotation matrix.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
hasPitch()
Only used in indoor.boolean
hasRoll()
Only used in indoor.java.lang.Boolean
hasRotationMatrix()
Return true if the location has a valid rotation matrix, false otherwise.boolean
isIndoor()
Return true if the location is indoorboolean
isOutdoor()
Return true if the location is outdoorjava.util.Map<java.lang.String,java.lang.Object>
toMap()
Method to transform object into Mapjava.lang.String
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 java.lang.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 java.lang.String getBuildingIdentifier()
Only used in indoor. Return the building identifier.- Specified by:
getBuildingIdentifier
in interfaceBuildingResource
-
getFloorIdentifier
public java.lang.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
-
hasPitch
public boolean hasPitch()
Only used in indoor. Return true if the location has pitch, false otherwise.- See Also:
getPitch()
-
getPitch
public Angle getPitch()
Only used in indoor. Return the pitch with respect to the horizon, being 0 perfectly horizontal. IfhasPitch()
is false the pitch returned could not be reliable.
-
hasRoll
public boolean hasRoll()
Only used in indoor. Return true if the location has roll, false otherwise.- See Also:
getRoll()
-
getRoll
public Angle getRoll()
Only used in indoor. Return the roll with respect to the horizon, being 0 perfectly horizontal. IfhasRoll()
is false the roll returned could not be reliable.
-
hasRotationMatrix
public java.lang.Boolean hasRotationMatrix()
Return true if the location has a valid rotation matrix, false otherwise.
-
getRotationMatrix
public float[] getRotationMatrix()
Return the rotation matrix. IfhasRotationMatrix()
is false the rotation matrix returned could not be reliable.
-
getProvider
public java.lang.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 java.util.Map<java.lang.String,java.lang.String> getCustomFields()
Returns map of custom fields, indexed by their name.- Returns:
- Unmodifiable
Map
<String
,String
>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toMap
public java.util.Map<java.lang.String,java.lang.Object> toMap()
Description copied from interface:MapperInterface
Method to transform object into Map- Specified by:
toMap
in interfaceMapperInterface
- Returns:
- Map
with the information of the object mapped
-
fromMap
public static Location fromMap(java.util.Map<java.lang.String,java.lang.Object> map) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
-