Class LinearRing
- Namespace
- NetTopologySuite.Geometries
- Assembly
- NetTopologySuite.dll
Models an OGC SFS LinearRing.
public class LinearRing : LineString, IComparable, IComparable<Geometry>, ILineal
- Inheritance
-
LinearRing
- Implements
- Inherited Members
Remarks
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 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.
Constructors
LinearRing(CoordinateSequence, GeometryFactory)
Constructs a LinearRing with the vertices specified
by the given CoordinateSequence.
public LinearRing(CoordinateSequence points, GeometryFactory factory)
Parameters
pointsCoordinateSequenceA sequence points forming a closed and simple linestring, or
nullto create the empty geometry.factoryGeometryFactoryThe factory that creates this
LinearRing
Exceptions
- ArgumentException
If the ring is not closed, or has too few points
LinearRing(Coordinate[])
Initializes a new instance of the LinearRing class.
public LinearRing(Coordinate[] points)
Parameters
pointsCoordinate[]The points used for create this instance.
Remarks
For create this Geometry is used a standard GeometryFactory
with PrecisionModel == Floating.
Exceptions
- ArgumentException
If the ring is not closed, or has too few points
Fields
MinimumValidSize
The minimum number of vertices allowed in a valid non-empty ring. Empty rings with 0 vertices are also valid.
public const int MinimumValidSize = 3
Field Value
Properties
BoundaryDimension
Returns Dimensions.False, since by definition LinearRings do not have a boundary.
public override Dimension BoundaryDimension { get; }
Property Value
GeometryType
Returns the name of this object's interface.
public override string GeometryType { get; }
Property Value
- string
"LinearRing"
IsCCW
Gets a value indicating if this LINEARRING is oriented CounterClockwise
public bool IsCCW { get; }
Property Value
IsClosed
public override bool IsClosed { get; }
Property Value
SortIndex
Gets a value to sort the geometry
protected override Geometry.SortIndexValue SortIndex { get; }
Property Value
Remarks
NOTE:
For JTS v1.17 this property's getter has been renamed to getTypeCode().
In order not to break binary compatibility we did not follow.
Methods
CopyInternal()
protected override Geometry CopyInternal()
Returns
Reverse()
[Obsolete("Call Geometry.Reverse()")]
public override Geometry Reverse()
Returns
ReverseInternal()
The actual implementation of the Reverse() function for LINEARRINGs.
protected override Geometry ReverseInternal()
Returns
- Geometry
A reversed geometry