Class GeoPolygon

  • java.lang.Object
    • com.here.sdk.core.GeoPolygon

  • public final class GeoPolygon
    extends java.lang.Object

    Represents a GeoPolygon area as a series of geographic coordinates, and optionally, a list of inner boundaries (also known as holes). An instance of this class, initialized with appropriate vertices.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.List<java.util.List<GeoCoordinates>> innerBoundaries
      The list of polygon inner boundaries (holes), each defined as a list of geographic coordinates.
      java.util.List<GeoCoordinates> vertices
      The list of geographic coordinates representing the outer boundary vertices of polygon.
    • Constructor Summary

      Constructors 
      Constructor Description
      GeoPolygon​(GeoBox geoBox)
      Constructs an instance of this class from GeoBox.
      GeoPolygon​(GeoCircle geoCircle)
      Constructs an instance of this class from GeoCircle.
      GeoPolygon​(java.util.List<GeoCoordinates> vertices)
      Constructs an instance of this class from the provided vertices.
      GeoPolygon​(java.util.List<GeoCoordinates> vertices, java.util.List<java.util.List<GeoCoordinates>> innerBoundaries)
      Constructs an instance of this class from the provided vertices and inner boundaries (holes).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • vertices

        @NonNull
        public final java.util.List<GeoCoordinates> vertices

        The list of geographic coordinates representing the outer boundary vertices of polygon.

      • innerBoundaries

        @NonNull
        public final java.util.List<java.util.List<GeoCoordinates>> innerBoundaries

        The list of polygon inner boundaries (holes), each defined as a list of geographic coordinates.

    • Constructor Detail

      • GeoPolygon

        public GeoPolygon​(@NonNull
                          java.util.List<GeoCoordinates> vertices)
                   throws InstantiationErrorException

        Constructs an instance of this class from the provided vertices. Throws InstantiationError if the number of vertices is less than three.

        Parameters:
        vertices -

        List of vertices representing the polygon outer boundary in clockwise order.

        Throws:
        InstantiationErrorException -

        Instantiation error.

      • GeoPolygon

        public GeoPolygon​(@NonNull
                          java.util.List<GeoCoordinates> vertices,
                          @NonNull
                          java.util.List<java.util.List<GeoCoordinates>> innerBoundaries)
                   throws InstantiationErrorException

        Constructs an instance of this class from the provided vertices and inner boundaries (holes). Throws InstantiationError if the number of vertices is less than three.

        Parameters:
        vertices -

        List of vertices representing the polygon outer boundary in clockwise order.

        innerBoundaries -

        List of polygon inner boundaries (holes), each in counterclockwise order.

        Throws:
        InstantiationErrorException -

        Instantiation error.

      • GeoPolygon

        public GeoPolygon​(@NonNull
                          GeoCircle geoCircle)

        Constructs an instance of this class from GeoCircle.

        Parameters:
        geoCircle -

        A GeoCircle to be converted into GeoPolygon.

      • GeoPolygon

        public GeoPolygon​(@NonNull
                          GeoBox geoBox)

        Constructs an instance of this class from GeoBox.

        Parameters:
        geoBox -

        A rectangle defined by the GeoBox to be converted into GeoPolygon. The corner coordinates defined by the GeoBox will define the outer boundary verticies of the GeoPolygon.

    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object