Table of Contents

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 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

LinearRing(CoordinateSequence, GeometryFactory)

Constructs a LinearRing with the vertices specified by the given CoordinateSequence.

public LinearRing(CoordinateSequence points, GeometryFactory factory)

Parameters

points CoordinateSequence

A sequence points forming a closed and simple linestring, or null to create the empty geometry.

factory GeometryFactory

The 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

points Coordinate[]

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

int

Properties

BoundaryDimension

Returns Dimensions.False, since by definition LinearRings do not have a boundary.

public override Dimension BoundaryDimension { get; }

Property Value

Dimension

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

bool

IsClosed

public override bool IsClosed { get; }

Property Value

bool

SortIndex

Gets a value to sort the geometry

protected override Geometry.SortIndexValue SortIndex { get; }

Property Value

Geometry.SortIndexValue

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

Geometry

Reverse()

[Obsolete("Call Geometry.Reverse()")]
public override Geometry Reverse()

Returns

Geometry

ReverseInternal()

The actual implementation of the Reverse() function for LINEARRINGs.

protected override Geometry ReverseInternal()

Returns

Geometry

A reversed geometry