GeoPolygon (API Reference)
Class GeoPolygon
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
FieldsModifier and TypeFieldDescriptionfinal List<List<GeoCoordinates>>The list of polygon inner boundaries (holes), each defined as a list of geographic coordinates.final List<GeoCoordinates>The list of geographic coordinates representing the outer boundary vertices of polygon. -
Constructor Summary
ConstructorsConstructorDescriptionGeoPolygon(GeoBox geoBox) Constructs an instance of this class fromGeoBox.GeoPolygon(GeoCircle geoCircle) Constructs an instance of this class fromGeoCircle.GeoPolygon(List<GeoCoordinates> vertices) Constructs an instance of this class from the provided vertices.GeoPolygon(List<GeoCoordinates> vertices, List<List<GeoCoordinates>> innerBoundaries) Constructs an instance of this class from the provided vertices and inner boundaries (holes). -
Method Summary
-
Field Details
-
vertices
The list of geographic coordinates representing the outer boundary vertices of polygon.
-
innerBoundaries
The list of polygon inner boundaries (holes), each defined as a list of geographic coordinates.
-
-
Constructor Details
-
GeoPolygon
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
Constructs an instance of this class from
GeoCircle.- Parameters:
geoCircle-A
GeoCircleto be converted intoGeoPolygon.
-
GeoPolygon
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.
-
-
Method Details