Class 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 Detail

      • EMPTY_INDOOR

        public static final Point EMPTY_INDOOR
      • EMPTY_OUTDOOR

        public static final Point EMPTY_OUTDOOR
      • CREATOR

        public static final android.os.Parcelable.Creator<Point> CREATOR
    • 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 the Bounds 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 from CartesianCoordinate using CoordinateConverter.
        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 interface BuildingResource
      • 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 interface FloorResource
        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)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • lookupKey

        public String lookupKey()
      • describeContents

        public int describeContents()
        Specified by:
        describeContents in interface android.os.Parcelable
      • writeToParcel

        public void writeToParcel​(android.os.Parcel dest,
                                  int flags)
        Specified by:
        writeToParcel in interface android.os.Parcelable