public interface Polygon extends Geometry
Polygon
.
This is a planar surface in a two-dimensional XY-plane, represented by one exterior boundary and 0 or more interior boundaries.
The default implementation returned by the driver is immutable.
Modifier and Type | Interface and Description |
---|---|
static interface |
Polygon.Builder
Provides a simple DSL to build a polygon.
|
Modifier and Type | Method and Description |
---|---|
static Polygon.Builder |
builder()
Returns a polygon builder.
|
static Polygon |
fromGeoJson(String source)
Creates a polygon from a GeoJSON
Polygon representation.
|
static Polygon |
fromPoints(Point p1,
Point p2,
Point p3,
Point... pn)
Creates a polygon from a series of 3 or more points.
|
static Polygon |
fromWellKnownBinary(ByteBuffer source)
Creates a polygon from its Well-known Binary
(WKB) representation.
|
static Polygon |
fromWellKnownText(String source)
Creates a polygon from its Well-known
Text (WKT) representation.
|
List<Point> |
getExteriorRing()
Returns the external ring of the polygon.
|
List<List<Point>> |
getInteriorRings()
Returns the internal rings of the polygon, i.e.
|
asGeoJson, asWellKnownBinary, asWellKnownText, contains
@NonNull static Polygon fromWellKnownText(@NonNull String source)
source
- the Well-known Text representation to parse.IllegalArgumentException
- if the string does not contain a valid Well-known Text
representation.@NonNull static Polygon fromWellKnownBinary(@NonNull ByteBuffer source)
source
- the Well-known Binary representation to parse.IllegalArgumentException
- if the provided ByteBuffer
does not contain a valid
Well-known Binary representation.@NonNull static Polygon fromGeoJson(@NonNull String source)
source
- the GeoJSON Polygon
representation to parse.IllegalArgumentException
- if the string does not contain a valid GeoJSON Polygon representation.@NonNull static Polygon fromPoints(@NonNull Point p1, @NonNull Point p2, @NonNull Point p3, @NonNull Point... pn)
@NonNull static Polygon.Builder builder()
This is intended for complex polygons with multiple rings (i.e. holes inside the polygon).
For simple cases, consider fromPoints(Point, Point, Point, Point...)
instead.
Copyright © 2017–2020. All rights reserved.