public class LinearRing extends LineString
LinearRing
.
A LinearRing
is a LineString
which is both closed and simple.
In other words,
the first and last coordinate in the ring must be equal,
and the ring must not self-intersect.
Either orientation of the ring is allowed.
A ring must have either 0 or 3 or more points.
The first and last points must be equal (in 2D).
If these conditions are not met, the constructors throw
an IllegalArgumentException
.
A ring with 3 points is invalid, because it is collapsed
and thus has a self-intersection. It is allowed to be constructed
so that it can be represented, and repaired if needed.
Modifier and Type | Field and Description |
---|---|
static int |
MINIMUM_VALID_SIZE
The minimum number of vertices allowed in a valid non-empty ring.
|
TYPENAME_GEOMETRYCOLLECTION, TYPENAME_LINEARRING, TYPENAME_LINESTRING, TYPENAME_MULTILINESTRING, TYPENAME_MULTIPOINT, TYPENAME_MULTIPOLYGON, TYPENAME_POINT, TYPENAME_POLYGON
Constructor and Description |
---|
LinearRing(Coordinate[] points,
PrecisionModel precisionModel,
int SRID)
Deprecated.
Use GeometryFactory instead
|
LinearRing(CoordinateSequence points,
GeometryFactory factory)
Constructs a
LinearRing with the vertices
specified by the given CoordinateSequence . |
Modifier and Type | Method and Description |
---|---|
int |
getBoundaryDimension()
Returns
Dimension.FALSE , since by definition LinearRings do
not have a boundary. |
String |
getGeometryType()
Returns the name of this Geometry's actual class.
|
boolean |
isClosed()
Tests whether this ring is closed.
|
LinearRing |
reverse()
Creates a
LineString whose coordinates are in the reverse
order of this objects |
LinearRing |
reverseInternal() |
apply, apply, apply, apply, clone, equalsExact, getBoundary, getCoordinate, getCoordinateN, getCoordinates, getCoordinateSequence, getDimension, getEndPoint, getLength, getNumPoints, getPointN, getStartPoint, isCoordinate, isEmpty, isRing, normalize
buffer, buffer, buffer, compareTo, compareTo, contains, convexHull, copy, coveredBy, covers, crosses, difference, disjoint, distance, equals, equals, equalsExact, equalsNorm, equalsTopo, geometryChanged, getArea, getCentroid, getEnvelope, getEnvelopeInternal, getFactory, getGeometryN, getInteriorPoint, getNumGeometries, getPrecisionModel, getSRID, getUserData, hasDimension, hashCode, intersection, intersects, isRectangle, isSimple, isValid, isWithinDistance, norm, overlaps, relate, relate, setSRID, setUserData, symDifference, toString, toText, touches, union, union, within
public static final int MINIMUM_VALID_SIZE
public LinearRing(Coordinate[] points, PrecisionModel precisionModel, int SRID)
LinearRing
with the given points.points
- points forming a closed and simple linestring, or
null
or an empty array to create the empty geometry.
This array must not contain null
elements.precisionModel
- the specification of the grid of allowable points
for this LinearRing
SRID
- the ID of the Spatial Reference System used by this
LinearRing
IllegalArgumentException
- if the ring is not closed, or has too few pointspublic LinearRing(CoordinateSequence points, GeometryFactory factory)
LinearRing
with the vertices
specified by the given CoordinateSequence
.points
- a sequence points forming a closed and simple linestring, or
null
to create the empty geometry.IllegalArgumentException
- if the ring is not closed, or has too few pointspublic int getBoundaryDimension()
Dimension.FALSE
, since by definition LinearRings do
not have a boundary.getBoundaryDimension
in class LineString
public boolean isClosed()
isClosed
in class LineString
public String getGeometryType()
Geometry
getGeometryType
in class LineString
Geometry
s actual classpublic LinearRing reverse()
LineString
LineString
whose coordinates are in the reverse
order of this objectsreverse
in class LineString
LineString
with coordinates in the reverse orderpublic LinearRing reverseInternal()
Copyright © 2024. All rights reserved.