com.vividsolutions.jts.geom
Class Polygon
- Cloneable, Comparable, Serializable
Represents a linear polygon, which may include holes.
The shell and holes of the polygon are represented by
LinearRing
s.
In a valid polygon, holes may touch the shell or other holes at a single point.
However, no sequence of touching holes may split the polygon into two pieces.
The orientation of the rings in the polygon does not matter.
The shell and holes must conform to the assertions specified in the
OpenGIS Simple Features
Specification for SQL .
apply , apply , apply , buffer , buffer , checkNotGeometryCollection , clone , compare , compareTo , compareToSameClass , computeEnvelopeInternal , contains , convexHull , crosses , difference , disjoint , distance , equal , equals , equalsExact , equalsExact , geometryChanged , geometryChangedAction , getArea , getBoundary , getBoundaryDimension , getCentroid , getCoordinate , getCoordinates , getDimension , getEnvelope , getEnvelopeInternal , getFactory , getGeometryN , getGeometryType , getInteriorPoint , getLength , getNumGeometries , getNumPoints , getPrecisionModel , getSRID , getUserData , hasNonEmptyElements , hasNullElements , intersection , intersects , isEmpty , isEquivalentClass , isRectangle , isSimple , isValid , isWithinDistance , normalize , overlaps , relate , relate , setSRID , setUserData , symDifference , toString , toText , touches , union , within |
holes
protected LinearRing[] holes
The interior boundaries, if any.
This instance var is never null.
If there are no holes, the array is of zero length.
shell
protected LinearRing shell
The exterior boundary,
or null
if this Polygon
is empty.
Polygon
public Polygon(LinearRing shell,
LinearRing[] holes,
GeometryFactory factory)
Constructs a Polygon
with the given exterior boundary and
interior boundaries.
shell
- the outer boundary of the new Polygon
,
or null
or an empty LinearRing
if the empty
geometry is to be created.holes
- the inner boundaries of the new Polygon
, or null
or empty LinearRing
s if the empty
geometry is to be created.
Polygon
public Polygon(LinearRing shell,
LinearRing[] holes,
PrecisionModel precisionModel,
int SRID)
Use GeometryFactory instead
Constructs a Polygon
with the given exterior boundary and
interior boundaries.
shell
- the outer boundary of the new Polygon
,
or null
or an empty LinearRing
if the empty
geometry is to be created.holes
- the inner boundaries of the new Polygon
, or null
or empty LinearRing
s if the empty
geometry is to be created.precisionModel
- the specification of the grid of allowable points
for this Polygon
SRID
- the ID of the Spatial Reference System used by this
Polygon
Polygon
public Polygon(LinearRing shell,
PrecisionModel precisionModel,
int SRID)
Use GeometryFactory instead
Constructs a Polygon
with the given exterior boundary.
shell
- the outer boundary of the new Polygon
,
or null
or an empty LinearRing
if the empty
geometry is to be created.precisionModel
- the specification of the grid of allowable points
for this Polygon
SRID
- the ID of the Spatial Reference System used by this
Polygon
getArea
public double getArea()
Returns the area of this Polygon
- getArea in interface Geometry
getExteriorRing
public LineString getExteriorRing()
getInteriorRingN
public LineString getInteriorRingN(int n)
getLength
public double getLength()
Returns the perimeter of this Polygon
- getLength in interface Geometry
- the perimeter of the polygon
getNumInteriorRing
public int getNumInteriorRing()