public final class Polygon extends Geometry
Constructor | Description |
---|---|
Polygon(CoordinateReferenceSystem coordinateReferenceSystem,
PolygonCoordinates coordinates) |
Construct an instance with the given coordinates and coordinate reference system.
|
Polygon(PolygonCoordinates coordinates) |
Construct an instance with the given coordinates.
|
Polygon(List<Position> exterior,
List<Position>... holes) |
Construct an instance with the given coordinates.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object o) |
|
PolygonCoordinates |
getCoordinates() |
Gets the GeoJSON coordinates of the polygon
|
List<Position> |
getExterior() |
Gets the exterior coordinates.
|
List<List<Position>> |
getHoles() |
Get the holes in this polygon.
|
GeoJsonObjectType |
getType() |
Gets the GeoJSON object type.
|
int |
hashCode() |
|
String |
toString() |
getCoordinateReferenceSystem, toJson
public Polygon(List<Position> exterior, List<Position>... holes)
exterior
- the exterior ring of the polygonholes
- optional interior rings of the polygonpublic Polygon(PolygonCoordinates coordinates)
coordinates
- the coordinatespublic Polygon(@Nullable CoordinateReferenceSystem coordinateReferenceSystem, PolygonCoordinates coordinates)
coordinateReferenceSystem
- the coordinate reference systemcoordinates
- the coordinatespublic GeoJsonObjectType getType()
Geometry
public PolygonCoordinates getCoordinates()
public List<Position> getExterior()
public List<List<Position>> getHoles()