Package mil.nga.sf
Class MultiPolygon
- java.lang.Object
-
- mil.nga.sf.Geometry
-
- mil.nga.sf.GeometryCollection<T>
-
- mil.nga.sf.MultiSurface<Polygon>
-
- mil.nga.sf.MultiPolygon
-
- All Implemented Interfaces:
Serializable
public class MultiPolygon extends MultiSurface<Polygon>
A restricted form of MultiSurface where each Surface in the collection must be of type Polygon.- Author:
- osbornb
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultiPolygon()
ConstructorMultiPolygon(boolean hasZ, boolean hasM)
ConstructorMultiPolygon(List<Polygon> polygons)
ConstructorMultiPolygon(MultiPolygon multiPolygon)
Copy ConstructorMultiPolygon(Polygon polygon)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPolygon(Polygon polygon)
Add a polygonvoid
addPolygons(List<Polygon> polygons)
Add polygonsGeometry
copy()
Copy the geometryPolygon
getPolygon(int n)
Returns the Nth polygonList<Polygon>
getPolygons()
Get the polygonsint
numPolygons()
Get the number of polygonsvoid
setPolygons(List<Polygon> polygons)
Set the polygons-
Methods inherited from class mil.nga.sf.MultiSurface
addSurface, addSurfaces, getSurface, getSurfaces, numSurfaces, setSurfaces
-
Methods inherited from class mil.nga.sf.GeometryCollection
addGeometries, addGeometry, equals, getAsGeometryCollection, getAsMultiCurve, getAsMultiLineString, getAsMultiPoint, getAsMultiPolygon, getAsMultiSurface, getCollectionType, getGeometries, getGeometry, hashCode, isEmpty, isMultiCurve, isMultiLineString, isMultiPoint, isMultiPolygon, isMultiSurface, isSimple, numGeometries, setGeometries
-
Methods inherited from class mil.nga.sf.Geometry
expandEnvelope, getCentroid, getDegreesCentroid, getDimension, getEnvelope, getGeometryType, hasM, hasZ, is3D, isMeasured, setHasM, setHasZ, updateZM
-
-
-
-
Constructor Detail
-
MultiPolygon
public MultiPolygon()
Constructor
-
MultiPolygon
public MultiPolygon(boolean hasZ, boolean hasM)
Constructor- Parameters:
hasZ
- has zhasM
- has m
-
MultiPolygon
public MultiPolygon(List<Polygon> polygons)
Constructor- Parameters:
polygons
- list of polygons
-
MultiPolygon
public MultiPolygon(Polygon polygon)
Constructor- Parameters:
polygon
- polygon
-
MultiPolygon
public MultiPolygon(MultiPolygon multiPolygon)
Copy Constructor- Parameters:
multiPolygon
- multi polygon to copy
-
-
Method Detail
-
setPolygons
public void setPolygons(List<Polygon> polygons)
Set the polygons- Parameters:
polygons
- polygons
-
addPolygon
public void addPolygon(Polygon polygon)
Add a polygon- Parameters:
polygon
- polygon
-
addPolygons
public void addPolygons(List<Polygon> polygons)
Add polygons- Parameters:
polygons
- polygons
-
numPolygons
public int numPolygons()
Get the number of polygons- Returns:
- number of polygons
-
getPolygon
public Polygon getPolygon(int n)
Returns the Nth polygon- Parameters:
n
- nth polygon to return- Returns:
- polygon
-
copy
public Geometry copy()
Copy the geometry- Overrides:
copy
in classGeometryCollection<Polygon>
- Returns:
- geometry copy
-
-