ST_POINTN (Lakehouse v1)
Returns a Point at a specified index in a LineString.
SQL Syntax
Section titled “SQL Syntax”ST_POINTN(<geometry>, <index>)Arguments
Section titled “Arguments”| Arguments | Description |
|---|---|
<geometry> | The argument must be an expression of type GEOMETRY that represents a LineString. |
<index> | The index of the Point to return. |
Return Type
Section titled “Return Type”Geometry.
SQL Examples
Section titled “SQL Examples”SELECT ST_POINTN( ST_GEOMETRYFROMWKT( 'LINESTRING(1 1, 2 2, 3 3, 4 4)' ), 1 ) AS pipeline_pointn;
┌─────────────────┐│ pipeline_pointn │├─────────────────┤│ POINT(1 1) │└─────────────────┘
SELECT ST_POINTN( ST_GEOMETRYFROMWKT( 'LINESTRING(1 1, 2 2, 3 3, 4 4)' ), -2 ) AS pipeline_pointn;
┌─────────────────┐│ pipeline_pointn │├─────────────────┤│ POINT(3 3) │└─────────────────┘