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.
Return Type: Boolean (true/false).
Formula: IsRing = IsClosed AND IsSimple
| Geometry | ST_IsRing Result |
|---|---|
| Closed, non-self-intersecting LineString | TRUE (valid ring) |
| Closed but self-intersecting LineString | FALSE |
| Open LineString (start ≠ end) | FALSE |
| Point, Polygon | FALSE |
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.