Class LinearRing
Models an OGC SFS LinearRing
.
Inherited Members
Namespace: NetTopologySuite.Geometries
Assembly: NetTopologySuite.dll
Syntax
[Serializable]
public class LinearRing : LineString, IComparable, IComparable<Geometry>, ILineal
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 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 ArgumentException
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
| Improve this Doc View SourceLinearRing(Coordinate[])
Initializes a new instance of the LinearRing class.
Declaration
public LinearRing(Coordinate[] points)
Parameters
Type | Name | Description |
---|---|---|
Coordinate[] | points | The points used for create this instance. |
Remarks
For create this Geometry is used a standard GeometryFactory
with PrecisionModel ==
Floating.
Exceptions
Type | Condition |
---|---|
ArgumentException | If the ring is not closed, or has too few points |
LinearRing(CoordinateSequence, GeometryFactory)
Constructs a LinearRing
with the vertices specified
by the given CoordinateSequence.
Declaration
public LinearRing(CoordinateSequence points, GeometryFactory factory)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequence | points | A sequence points forming a closed and simple linestring,
or |
GeometryFactory | factory | The factory that creates this |
Exceptions
Type | Condition |
---|---|
ArgumentException | If the ring is not closed, or has too few points |
Fields
| Improve this Doc View SourceMinimumValidSize
The minimum number of vertices allowed in a valid non-empty ring. Empty rings with 0 vertices are also valid.
Declaration
public const int MinimumValidSize = 3
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceBoundaryDimension
Returns Dimensions.False
, since by definition LinearRings do not have a boundary.
Declaration
public override Dimension BoundaryDimension { get; }
Property Value
Type | Description |
---|---|
Dimension |
Overrides
| Improve this Doc View SourceGeometryType
Returns the name of this object's interface.
Declaration
public override string GeometryType { get; }
Property Value
Type | Description |
---|---|
String | "LinearRing" |
Overrides
| Improve this Doc View SourceIsCCW
Gets a value indicating if this LINEARRING
is oriented CounterClockwise
Declaration
public bool IsCCW { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsClosed
Declaration
public override bool IsClosed { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceSortIndex
Gets a value to sort the geometry
Declaration
protected override Geometry.SortIndexValue SortIndex { get; }
Property Value
Type | Description |
---|---|
Geometry.SortIndexValue |
Overrides
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
| Improve this Doc View SourceCopyInternal()
Declaration
protected override Geometry CopyInternal()
Returns
Type | Description |
---|---|
Geometry |
Overrides
| Improve this Doc View SourceReverse()
Declaration
[Obsolete("Call Geometry.Reverse()")]
public override Geometry Reverse()
Returns
Type | Description |
---|---|
Geometry |
Overrides
| Improve this Doc View SourceReverseInternal()
The actual implementation of the Reverse() function for LINEARRING
s.
Declaration
protected override Geometry ReverseInternal()
Returns
Type | Description |
---|---|
Geometry | A reversed geometry |