Class GeoPolygon

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

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

    • vertices

      @NonNull public final List<GeoCoordinates> vertices

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

    • innerBoundaries

      @NonNull public final List<List<GeoCoordinates>> innerBoundaries

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

  • Constructor Details

    • GeoPolygon

      public GeoPolygon(@NonNull 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 List<GeoCoordinates> vertices, @NonNull List<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 Details