Posted on

STMeasureRange

STMeasureRange — Returns (Last Point M Value) – (First Point M Value).

Function Specification.

Function STMeasureRange (
           @p_linestring geometry
         )
Returns varchar(5)

Description.

Returns end point measure value – start point measure value.

If line-string not measured, returns length of line.

Parameters.

    @p_linestring (geometry) - Supplied Linestring geometry.

Result.

Returns the measure range for measured line-string: NULL if not measured.

Example.

select [lrs].[STMeasureRange](geometry::STGeomFromText('LINESTRING(1 1,2 2)', 0)) as range
union all
select [lrs].[STMeasureRange](geometry::STGeomFromText('LINESTRING(1 1 2 3, 2 2 3 4)', 0)) as range
union all
select [lrs].[STMeasureRange](geometry::STGeomFromText('MULTILINESTRING((1 1 2 3, 2 2 3 4),(3 3 4 5,4 4 5 6))', 0))
union all
select [lrs].[STMeasureRange](geometry::STGeomFromText('CIRCULARSTRING (3 6.325 NULL 0, 0 7 NULL 3.08, -3 6.325 NULL 6.15)',0))
GO

range
NULL
1
3
6.15
Leave a Reply

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