class MultiPolygon extends GeometryCollection
A MultiPolygon Geometry.
You can create a MultiPolygon from a variable List of Polygons:
MultiPolygon mp = new MultiPolygon(new Polygon([1,2],[3,4],[5,6],[1,2]), new Polygon([7,8],[9,10],[11,12],[7,8]))
Or from a variable List of List of Doubles:
MultiPolygon mp = new MultiPolygon([[[1,2],[3,4],[5,6],[1,2]]], [[[7,8],[9,10],[11,12],[7,8]]])
Or from a List of Polygons:
MultiPolygon mp = new MultiPolygon([new Polygon([1,2],[3,4],[5,6],[1,2]), new Polygon([7,8],[9,10],[11,12],[7,8])])
Or form a List of List of List of Doubles:
MultiPolygon mp = new MultiPolygon([[[[1,2],[3,4],[5,6],[1,2]]], [[[7,8],[9,10],[11,12],[7,8]]]])
Constructor and description |
---|
MultiPolygon
(MultiPolygon multiPolygon) Create a MultiPolygon that wraps a JTS MultiPolygon |
MultiPolygon
(Polygon[] polygons) Create a MultiPolygon from a variable List of Polygons |
MultiPolygon
(java.util.List<java.util.List<java.util.List<java.lang.Double>>>[] polygons) Create a MultiPolygon from a variable List of List of List of Doubles |
MultiPolygon
(java.util.List polygons) Create a MultiPolygon from a List of Polygons or a List of List of List of Doubles |
Type Params | Return Type | Name and description |
---|---|---|
|
MultiPolygon |
plus(Polygon poly) Add a Polygon to this MultiPolygon to create another MultiPolygon |
|
Geometry |
split(LineString lineString) Split a Polygon with a LineString |
|
Geometry |
split(MultiLineString multiLineString) Split a Polygon with a MultiLineString |
Create a MultiPolygon that wraps a JTS MultiPolygon
multiPolygon
- The JTS MultiPolygonCreate a MultiPolygon from a variable List of Polygons
MultiPolygon mp = new MultiPolygon(new Polygon([1,2],[3,4],[5,6],[1,2]), new Polygon([7,8],[9,10],[11,12],[7,8]))
polygons
- A variable List of PolygonsCreate a MultiPolygon from a variable List of List of List of Doubles
MultiPolygon mp = new MultiPolygon([[[1,2],[3,4],[5,6],[1,2]]], [[[7,8],[9,10],[11,12],[7,8]]])
polygons
- A variable List of List of DoublesCreate a MultiPolygon from a List of Polygons or a List of List of List of Doubles
MultiPolygon mp = new MultiPolygon([new Polygon([1,2],[3,4],[5,6],[1,2]), new Polygon([7,8],[9,10],[11,12],[7,8])]) MultiPolygon mp = new MultiPolygon([[[[1,2],[3,4],[5,6],[1,2]]], [[[7,8],[9,10],[11,12],[7,8]]]])
polygons
- A List of Polygons or a List of List of List of DoublesAdd a Polygon to this MultiPolygon to create another MultiPolygon
def mp1 = new MultiPolygon(new Polygon([1,2],[3,4],[5,6],[1,2]), new Polygon([7,8],[9,10],[11,12],[7,8])) def mp2 = mp1 + new Polygon([11,12],[13,14],[15,16],[11,12]) MULTIPOLYGON (((1 2, 3 4, 5 6, 1 2)), ((7 8, 9 10, 11 12, 7 8)), ((11 12, 13 14, 15 16, 11 12)))
poly
- The Polygon to add to this PolygonSplit a Polygon with a LineString
lineString
- The LineStringSplit a Polygon with a MultiLineString
multiLineString
- The MultiLineString