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
public class Point extends Object implements FloorResource, android.os.Parcelable
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
-
Constructor Summary
Constructors Constructor Description Point(Building building, String floorIdentifier, CartesianCoordinate cartesianCoordinate)Create a point placed indoors.Point(Building building, String floorIdentifier, Coordinate coordinate)Create a point placed indoors.Point(Point point)Point(Coordinate coordinate)Create a point placed outdoors.Point(String buildingIdentifier, Coordinate coordinate)Create a point placed outdoors.Point(String buildingIdentifier, String floorIdentifier, Coordinate coordinate, CartesianCoordinate cartesianCoordinate)Create a point placed indoors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()booleanequals(Object o)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.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.StringlookupKey()booleansameFloor(Point that)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 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 String buildingIdentifier, @NonNull 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 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 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 String getBuildingIdentifier()
Returns unique identifier for the building to which this point belongs- Specified by:
getBuildingIdentifierin interfaceBuildingResource
-
getFloorIdentifier
@NonNull public final 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)
-
lookupKey
public 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
-
-