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 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
| Edit this page View SourceLinearRing(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  | 
      
LinearRing(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  | 
      
Fields
| Edit this page 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 | 
|---|---|
| int | 
Properties
| Edit this page 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
| Edit this page View SourceGeometryType
Returns the name of this object's interface.
Declaration
public override string GeometryType { get; }
  Property Value
| Type | Description | 
|---|---|
| string | "LinearRing"  | 
      
Overrides
| Edit this page View SourceIsCCW
Gets a value indicating if this LINEARRING is oriented CounterClockwise
Declaration
public bool IsCCW { get; }
  Property Value
| Type | Description | 
|---|---|
| bool | 
IsClosed
Declaration
public override bool IsClosed { get; }
  Property Value
| Type | Description | 
|---|---|
| bool | 
Overrides
| Edit this page 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
| Edit this page View SourceCopyInternal()
An internal method to copy subclass-specific geometry data.
Declaration
protected override Geometry CopyInternal()
  Returns
| Type | Description | 
|---|---|
| Geometry | A copy of the target geometry object.  | 
      
Overrides
| Edit this page View SourceReverse()
Computes a new geometry which has all component coordinate sequences in reverse order (opposite orientation) to this one.
Declaration
[Obsolete("Call Geometry.Reverse()")]
public override Geometry Reverse()
  Returns
| Type | Description | 
|---|---|
| Geometry | A reversed geometry  | 
      
Overrides
Remarks
Don't override this function, implement ReverseInternal().
ReverseInternal()
The actual implementation of the Reverse() function for LINEARRINGs.
Declaration
protected override Geometry ReverseInternal()
  Returns
| Type | Description | 
|---|---|
| Geometry | A reversed geometry  |