Class Point

java.lang.Object
es.situm.sdk.model.cartography.Point
All Implemented Interfaces:
android.os.Parcelable, BuildingResource, FloorResource, MapperInterface

public class Point extends 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 Details

    • 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 Details

    • 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 Details

    • 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)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString 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
    • toMap

      public Map<String,Object> toMap()
      Description copied from interface: MapperInterface
      Method to transform object into Map<String, Object>
      Specified by:
      toMap in interface MapperInterface
      Returns:
      Map<String, Object> with the information of the object mapped
    • fromMap

      public static Point fromMap(Map<String,Object> map) throws IllegalArgumentException
      Return a new Point instance object containing the data at the given map. Use MapperInterface to 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:
      IllegalArgumentException - If there is not enough information at the given map or it is incorrect.