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>
CREATOR
static Point
EMPTY_INDOOR
static Point
EMPTY_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 int
describeContents()
boolean
equals(Object o)
String
getBuildingIdentifier()
Returns unique identifier for the building to which this point belongsCartesianCoordinate
getCartesianCoordinate()
Returns cartesian coordinate (in meters) relative to theBounds
of building's base.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 fromCartesianCoordinate
usingCoordinateConverter
.String
getFloorIdentifier()
Returns floor identifier (inside the building) where this point is placed.int
hashCode()
boolean
isIndoor()
Return if the POI is inside the building.boolean
isOutdoor()
Return if the POI is outside the building.String
lookupKey()
boolean
sameFloor(Point that)
String
toString()
void
writeToParcel(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 theBounds
of 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:
Coordinate
of 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 fromCartesianCoordinate
usingCoordinateConverter
.- Returns:
Coordinate
of this point.
-
getBuildingIdentifier
@NonNull public final String getBuildingIdentifier()
Returns unique identifier for the building to which this point belongs- Specified by:
getBuildingIdentifier
in 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:
getFloorIdentifier
in 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:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-