Class SpatialPointN
- Namespace
- YndigoBlue.Velocity.Functions
- Assembly
- YndigoBlue.Velocity.dll
Represents the ST_PointN spatial accessor function that returns the Nth point in a linestring geometry.
public class SpatialPointN : Function, IElement, ICheckItem, IDefaultItem, IFilterItem
- Inheritance
-
SpatialPointN
- Implements
Remarks
Warning
Spatial functions are not available in the Community Edition of Velocity. They require the Full Edition.
The ST_PointN function returns a point geometry representing the Nth vertex (1-based index) of a linestring. The first point is at index 1, not 0. For multi-linestrings or non-linestring geometries, behavior varies by database implementation. Negative indices may access points from the end in some implementations. For Geometry types in planar coordinate systems, this is useful for extracting specific vertices, analyzing linestring structure, or sampling points along a line. OGC-compliant.
Return Type: Point geometry.
| Function Call | Result |
|---|---|
| ST_PointN(line, 1) | First vertex (same as ST_StartPoint) |
| ST_PointN(line, 3) | Third vertex |
| ST_PointN(line, N) | Last vertex where N = ST_NumPoints (same as ST_EndPoint) |
| ST_PointN(line, 99) on 5-point line | NULL (out of range) |
Constructors
- SpatialPointN(Geometry, int)
Initializes a new instance of ST_PointN with a linestring geometry literal and point index.
- SpatialPointN(Column, int)
Initializes a new instance of ST_PointN with a linestring geometry column and point index.
- SpatialPointN(Function, int)
Initializes a new instance of ST_PointN for a function result.
- SpatialPointN(Geography, int)
Initializes a new instance of ST_PointN with a linestring geography literal and point index.