Package es.situm.sdk.model.cartography
Class Point
- java.lang.Object
-
- es.situm.sdk.model.cartography.Point
-
- All Implemented Interfaces:
android.os.Parcelable,BuildingResource,FloorResource,MapperInterface
public class Point extends java.lang.Object implements FloorResource, android.os.Parcelable, MapperInterface
Associate geographical coordinate (Location) with Building and Floor (Cartography) and cartesian coordinate relative to that building. Instances are immutable.
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<Point>CREATORstatic PointEMPTY_INDOORstatic PointEMPTY_OUTDOOR-
Fields inherited from interface es.situm.sdk.model.MapperInterface
ACCESSIBILITY_MODE, ACCURACY, ADDRESS, ALTITUDE, ASSET_TRACKING_OPTIONS_BEACON_FILTERS, ASSET_TRACKING_OPTIONS_ENABLED, ASSET_TRACKING_OPTIONS_ITERATIONS_TO_UPLOAD, ASSET_TRACKING_OPTIONS_SCANNING_INTERVAL, BEACON_FILTER_UUID, 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
-
-
Constructor Summary
Constructors Constructor Description Point(Building building, java.lang.String floorIdentifier, CartesianCoordinate cartesianCoordinate)Create a point placed indoors.Point(Building building, java.lang.String floorIdentifier, Coordinate coordinate)Create a point placed indoors.Point(Point point)Point(Coordinate coordinate)Create a point placed outdoors.Point(java.lang.String buildingIdentifier, Coordinate coordinate)Create a point placed outdoors.Point(java.lang.String buildingIdentifier, java.lang.String floorIdentifier, Coordinate coordinate, CartesianCoordinate cartesianCoordinate)Create a point placed indoors.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()booleanequals(java.lang.Object o)static PointfromMap(java.util.Map<java.lang.String,java.lang.Object> map)Return a newPointinstance object containing the data at the given map.java.lang.StringgetBuildingIdentifier()Returns unique identifier for the building to which this point belongsCartesianCoordinategetCartesianCoordinate()Returns cartesian coordinate (in meters) relative to theBoundsof building's base.CoordinategetCoordinate()Returns geographic coordinate (latitude, longitude) of the point, regardless of whether it's placed inside or outside the building You can obtain this value fromCartesianCoordinateusingCoordinateConverter.java.lang.StringgetFloorIdentifier()Returns floor identifier (inside the building) where this point is placed.inthashCode()booleanisIndoor()Return if the POI is inside the building.booleanisOutdoor()Return if the POI is outside the building.java.lang.StringlookupKey()booleansameFloor(Point that)java.util.Map<java.lang.String,java.lang.Object>toMap()Method to transform object into Mapjava.lang.StringtoString()voidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Constructor Detail
-
Point
public Point(@NonNull Coordinate coordinate)Create a point placed outdoors. It has no cartesian coordinate nor floor, because it's placed outside the building.- Parameters:
coordinate-
-
Point
public Point(@NonNull java.lang.String buildingIdentifier, @NonNull Coordinate coordinate)Create a point placed outdoors. It has no cartesian coordinate nor floor, because it's placed outside the building.- Parameters:
buildingIdentifier-coordinate-
-
Point
public Point(@NonNull java.lang.String buildingIdentifier, @NonNull java.lang.String floorIdentifier, @NonNull Coordinate coordinate, @NonNull CartesianCoordinate cartesianCoordinate)Create a point placed indoors.- Parameters:
buildingIdentifier-floorIdentifier-coordinate-cartesianCoordinate-
-
Point
public Point(@NonNull Building building, @NonNull java.lang.String floorIdentifier, @NonNull CartesianCoordinate cartesianCoordinate)Create a point placed indoors. The geographical coordinate is calculated using the building
-
Point
public Point(@NonNull Building building, @NonNull java.lang.String floorIdentifier, @NonNull Coordinate coordinate)Create a point placed indoors. The cartesian coordinate is calculated using the building
-
Point
public Point(@NonNull Point point)
-
-
Method Detail
-
getCartesianCoordinate
@NonNull public final CartesianCoordinate getCartesianCoordinate()
Returns cartesian coordinate (in meters) relative to theBoundsof building's base. If this point is outdoors (isOutdoor== true), this field has no meaning.Use
isOutdoor()to check if the poi is indoors or outdoors- Returns:
Coordinateof this point, or (0,0) if it's outdoors.
-
getCoordinate
@NonNull public final Coordinate getCoordinate()
Returns geographic coordinate (latitude, longitude) of the point, regardless of whether it's placed inside or outside the building You can obtain this value fromCartesianCoordinateusingCoordinateConverter.- Returns:
Coordinateof this point.
-
getBuildingIdentifier
@NonNull public final java.lang.String getBuildingIdentifier()
Returns unique identifier for the building to which this point belongs- Specified by:
getBuildingIdentifierin interfaceBuildingResource
-
getFloorIdentifier
@NonNull public final java.lang.String getFloorIdentifier()
Returns floor identifier (inside the building) where this point is placed. If this point is outdoors, this field has no meaning.See
isOutdoor()to check if the poi is indoors or outdoors- Specified by:
getFloorIdentifierin interfaceFloorResource- Returns:
String. If the point is outdoors, the value is unexpected.
-
isOutdoor
public final boolean isOutdoor()
Return if the POI is outside the building.- Returns:
- true if the building is outdoors. Otherwise, false.
-
isIndoor
public final boolean isIndoor()
Return if the POI is inside the building.- Returns:
- true if the building is indoors. Otherwise, false.
-
sameFloor
public final boolean sameFloor(Point that)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
lookupKey
public java.lang.String lookupKey()
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
toMap
public java.util.Map<java.lang.String,java.lang.Object> toMap()
Description copied from interface:MapperInterfaceMethod to transform object into Map- Specified by:
toMapin interfaceMapperInterface- Returns:
- Map
with the information of the object mapped
-
fromMap
public static Point fromMap(java.util.Map<java.lang.String,java.lang.Object> map) throws java.lang.IllegalArgumentException
Return a newPointinstance object containing the data at the given map. UseMapperInterfaceto populate the Map. The expected fields are those defined at this class.- Parameters:
map- Map containing the data used to populate the new object.- Returns:
- New instance.
- Throws:
java.lang.IllegalArgumentException- If there is not enough information at the given map or it is incorrect.
-
-