Table of Contents

Class SpatialIsRing

Namespace
YndigoBlue.Velocity.Functions
Assembly
YndigoBlue.Velocity.dll

Represents the ST_IsRing spatial validation function that tests whether a linestring is a valid ring.

public class SpatialIsRing : Function, ICheckItem, IDefaultItem, IFilterItem, IElement
Inheritance
SpatialIsRing
Implements

Remarks

Warning

Spatial functions are not available in the Community Edition of Velocity. They require the Full Edition.

The ST_IsRing function returns true if the linestring is both closed (start and end points are the same) and simple (does not self-intersect). A valid ring is suitable for use as a polygon boundary. For non-linestring geometries, typically returns false. This is a stricter test than ST_IsClosed, which only checks closure. For Geometry types in planar coordinate systems, this is useful for validating polygon rings, topology analysis, or ensuring proper geometry construction before creating polygons. OGC-compliant.

SpatialIsRing diagram showing ring validation

Return Type: Boolean (true/false).

Formula: IsRing = IsClosed AND IsSimple

GeometryST_IsRing Result
Closed, non-self-intersecting LineStringTRUE (valid ring)
Closed but self-intersecting LineStringFALSE
Open LineString (start ≠ end)FALSE
Point, PolygonFALSE

Examples

Identify which line geometries form valid rings (closed and simple):

var schema = manager.LoadSchema("gis");
var lines = schema["lines"];

var query = new Query()
    .Select([ lines["id"], new Expression("is_ring", new SpatialIsRing(lines["path"])) ])
    .From(lines);

var results = manager.Retrieve(query);

Constructors

SpatialIsRing(Geometry)

Initializes a new instance of ST_IsRing with a linestring geometry literal.

SpatialIsRing(Column)

Initializes a new instance of ST_IsRing with a linestring geometry column.

SpatialIsRing(Function)

Initializes a new instance of ST_IsRing for a function result.

SpatialIsRing(Geography)

Initializes a new instance of ST_IsRing with a linestring geography literal.