Posted on

STValidLrsGeometry

STValidLrsGeometry — Checks if supplied @p_linestring is a valid measured linestring.

Function Specification.

Function STValidLrsGeometry (
           @p_linestring geometry
         )
Returns bit

Description.

This function checks for geometry type and number of dimensions of the geometric segment.

Function returns 1 (true) if provided geometry is a linestring with valid measured, and 0 (false) otherwise.

Linestring must have either increasing or decreasing measures.

The function supports all Linestring geometry types.

Parameters.

    @p_linestring (geometry) - Measured Linestring.

Result.

Returns 1 (true) if measured linestring, 0 (false) otherwise.

Example.

select [lrs].[STValidLrsGeometry](geometry::STGeomFromText('LINESTRING(0 0,50 50,100 100)',0)) as is_measured
GO

is_measured
0

select [lrs].[STValidLrsGeometry](geometry::STGeomFromText('LINESTRING(0 0 NULL 1,50 50 NULL 14.1,100 100 NULL 141.1)',0)) as is_measured
GO

is_measured
1
Leave a Reply

Your email address will not be published. Required fields are marked *