Class LinearRing

Hierarchy: Object , Geometry, LineString, LinearRing
All Implemented Interfaces: Cloneable , Comparable , Serializable , Lineal
public class LinearRing
extends LineString
Models an OGC SFS 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 interior of the ring must not self-intersect. Either orientation of the ring is allowed.

A ring must have either 0 or 4 or more points. The first and last points must be equal (in 2D). If these conditions are not met, the constructors throw an IllegalArgumentException

Other

  • version: 1.7
public LinearRing(Coordinate[] points, PrecisionModel precisionModel, int SRID)
Constructs a LinearRing with the given points.
Parameters:
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 - precisionModel the specification of the grid of allowable points for this LinearRing
SRID - SRID the ID of the Spatial Reference System used by this LinearRing
Throws:
IllegalArgumentException - IllegalArgumentException if the ring is not closed, or has too few points
Deprecation:
Use GeometryFactory instead
public LinearRing(CoordinateSequence points, GeometryFactory factory)
Constructs a LinearRing with the vertices specified by the given CoordinateSequence.
Parameters:
points - points a sequence points forming a closed and simple linestring, or null to create the empty geometry.
Throws:
IllegalArgumentException - IllegalArgumentException if the ring is not closed, or has too few points
public int getBoundaryDimension()
Returns Dimension.FALSE, since by definition LinearRings do not have a boundary.
Returns:
Dimension.FALSE
public boolean isClosed()
Tests whether this ring is closed. Empty rings are closed by definition.
Returns:
true if this ring is closed
public String getGeometryType()
protected int getTypeCode()
protected LinearRing copyInternal()
public LinearRing reverse()
public LinearRing reverseInternal()