Class GeoPolygon
Class GeoPolygon
- java.lang.Object
-
- com.here.sdk.core.GeoPolygon
-
public final class GeoPolygon extends java.lang.ObjectRepresents a
GeoPolygonarea 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>>innerBoundariesThe list of polygon inner boundaries (holes), each defined as a list of geographic coordinates.java.util.List<GeoCoordinates>verticesThe 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 fromGeoBox.GeoPolygon(GeoCircle geoCircle)Constructs an instance of this class fromGeoCircle.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 booleanequals(java.lang.Object obj)inthashCode()
-
-
-
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 InstantiationErrorExceptionConstructs 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 InstantiationErrorExceptionConstructs 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
GeoCircleto be converted intoGeoPolygon.
-
GeoPolygon
public GeoPolygon(@NonNull GeoBox geoBox)Constructs an instance of this class from
GeoBox.- Parameters:
geoBox-A rectangle defined by the
GeoBoxto be converted intoGeoPolygon. The corner coordinates defined by theGeoBoxwill define the outer boundary verticies of theGeoPolygon.
-
-