Table of Contents

Class SpatialIsClosed

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

Represents the ST_IsClosed spatial property function that tests whether a linestring or multi-linestring is closed.

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

Remarks

Warning

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

The ST_IsClosed function returns true if the geometry is a linestring or multi-linestring where the start and end points are coincident (the same point), forming a closed loop. For other geometry types, the result may be false or undefined. A closed linestring has identical first and last coordinates. This is distinct from ST_IsRing, which also requires the linestring to be simple (non-self-intersecting). For Geometry types in planar coordinate systems, useful for validating polygon boundaries, detecting loops, or topology analysis. OGC-compliant.

SpatialIsClosed diagram showing closed vs open linestrings

Return Type: Boolean (true/false).

GeometryST_IsClosed Result
LineString where first = last pointTRUE
LineString where first ≠ last pointFALSE
MultiLineString (all lines closed)TRUE
MultiLineString (any line open)FALSE
Polygon boundaryTRUE (always closed)
PointFALSE

Examples

Identify which route geometries form closed loops:

var schema = manager.LoadSchema("logistics");
var routes = schema["routes"];

var query = new Query()
    .Select([ routes["id"], routes["name"], new Expression("is_closed", new SpatialIsClosed(routes["path"])) ])
    .From(routes);

var results = manager.Retrieve(query);

Constructors

SpatialIsClosed(Geometry)

Initializes a new instance of ST_IsClosed with a geometry literal.

SpatialIsClosed(Column)

Initializes a new instance of ST_IsClosed with a geometry column.

SpatialIsClosed(Function)

Initializes a new instance of ST_IsClosed for a function result.

SpatialIsClosed(Geography)

Initializes a new instance of ST_IsClosed with a geography literal.