Class MultiPolygon

Hierarchy: Object , Geometry, GeometryCollection, MultiPolygon
All Implemented Interfaces: Cloneable , Comparable , Serializable , Polygonal
public class MultiPolygon
extends GeometryCollection
implements Polygonal
Models a collection of Polygons.

As per the OGC SFS specification, the Polygons in a MultiPolygon may not overlap, and may only touch at single points. This allows the topological point-set semantics to be well-defined.

Other

  • version: 1.7
public MultiPolygon(Polygon[] polygons, PrecisionModel precisionModel, int SRID)
Constructs a MultiPolygon.
Parameters:
polygons - polygons the Polygons for this MultiPolygon , or null or an empty array to create the empty geometry. Elements may be empty Polygons, but not null s. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL .
precisionModel - precisionModel the specification of the grid of allowable points for this MultiPolygon
SRID - SRID the ID of the Spatial Reference System used by this MultiPolygon
Deprecation:
Use GeometryFactory instead
public MultiPolygon(Polygon[] polygons, GeometryFactory factory)
Parameters:
polygons - polygons the Polygons for this MultiPolygon, or null or an empty array to create the empty geometry. Elements may be empty Polygons, but not nulls. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL.
public int getDimension()
public int getBoundaryDimension()
public String getGeometryType()
public Geometry getBoundary()
Computes the boundary of this geometry
See also:
Geometry#getBoundary
Returns:
a lineal geometry (which may be empty)
public boolean equalsExact(Geometry other, double tolerance)
public MultiPolygon reverse()
Creates a MultiPolygon with every component reversed. The order of the components in the collection are not reversed.
Returns:
a MultiPolygon in the reverse order
protected MultiPolygon copyInternal()
protected int getTypeCode()