Class PolygonGeometry

  • All Implemented Interfaces:
    MPModelBase

    public class PolygonGeometry
    extends Geometry
    MapsIndoors GeoJSON's Polygon implementation
    • Constructor Detail

      • PolygonGeometry

        public PolygonGeometry()
    • Method Detail

      • getCoordinates

        @NonNull
        public double[][][] getCoordinates()
      • getBBox

        @Nullable
        public double[] getBBox()
        The values of a "bbox" array are "[west, south, east, north]", not "[minx, miny, maxx, maxy]"
        Returns:
        An optional AABB (axis-aligned bounding box)
        See Also:
        GeoJSON - Bounding Box
      • getGMSPath

        @NonNull
        public java.util.List<java.util.List<com.google.android.gms.maps.model.LatLng>> getGMSPath()
        A LatLng version of getPoints()
        Returns:
        First list is the polygon outline, the rest (if any), holes
      • getPoints

        @Nullable
        public java.util.List<java.util.List<Point>> getPoints()
      • setCoordinates

        public void setCoordinates​(@NonNull
                                   double[][][] coordinates)
      • setBBox

        public void setBBox​(@NonNull
                            double[] bbox)
      • getBBoxAsList

        @Nullable
        public java.util.List<java.lang.Double> getBBoxAsList()
      • getPosition

        @Nullable
        public Point getPosition()
        Method to get the (average) point of the geometry
        Returns:
        A point describing the geometry (defined here as the average lat/lng)
      • getLatLngBounds

        @NonNull
        public com.google.android.gms.maps.model.LatLngBounds getLatLngBounds()
      • getArea

        public float getArea()
        Returns:
        Since:
        3.0.0
      • isInside

        public boolean isInside​(@NonNull
                                com.google.android.gms.maps.model.LatLng latLng)
      • isInside

        public boolean isInside​(@NonNull
                                Point point)
      • getSquaredDistanceToClosestEdge

        public float getSquaredDistanceToClosestEdge​(@NonNull
                                                     com.google.android.gms.maps.model.LatLng latLng)
        Parameters:
        latLng -
        Returns:
        The distance from the given point to this polygon's closest edge or -1 if the given point is outside this polygon's bounding box
        Since:
        3.0.0
      • getSquaredDistanceToClosestEdge

        public float getSquaredDistanceToClosestEdge​(@NonNull
                                                     Point point)
        Parameters:
        point -
        Returns:
        The distance from the given point to this polygon's closest edge or -1 if the given point is outside this polygon's bounding box
        Since:
        3.0.0
      • toString

        @NonNull
        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object