Posted on

STEndMeasure

STEndMeasure — Returns M value of last point in a measured geometry.

Function Specification.

    Function STEndMeasure (
       @p_linestring geometry
    )
    Returns geometry 

Description.

Returns the measure associated with the last point in a measured (multi)line-string.

If the line-string is not measured it returns 0.

Supports Linestrings with CircularString elements (2012).

Parameters.

    @p_linestring (geometry) - Supplied Linestring geometry.

Result.

The value of the measure ordinates of the last point in a measured linestring is returned.

Example.

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

end_measure
4
6
6.15
Leave a Reply

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