STIsMeasureIncreasing

STIsMeasureIncreasing — Checks if M values increase in value over the whole linestring.

Function Specification.

Function [lrs].[STIsMeasureIncreasing] (
                  @p_linestring geometry
         )
Returns varchar(5)

Description.

Checks all measures of all vertices in a linestring from start to end.

Computes difference between each pair of measures.

If all measure differences increase then TRUE is returned, otherwise FALSE.

For non-measured line-strings the value is always TRUE.

Supports Linestrings with CircularString elements (2012).

Result.

Returns TRUE if measures are increasing; FALSE otherwise.

Example.

select [lrs].[STIsMeasureIncreasing](geometry::STGeomFromText('MULTILINESTRING((1 1 2 3, 2 2 3 4),(3 3 4 5,4 4 5 6))',0)) is_increasing
union all
select [lrs].[STIsMeasureIncreasing]([dbo].[STReverse](geometry::STGeomFromText('MULTILINESTRING((1 1 2 3, 2 2 3 4),(3 3 4 5,4 4 5 6))',0),1,1)) is_increasing
union all
select [lrs].[STIsMeasureIncreasing](geometry::STGeomFromText('CIRCULARSTRING (3 6.325 NULL 0, 0 7 NULL 3.08, -3 6.325 NULL 6.15)',0)) is_increasing
GO

is_increasing
TRUE
FALSE
TRUE

Leave a Reply

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