Posted on

STSetM

STSetM — Function that adds or updates (replaces) M value of supplied geometry point.

Function Specification.

    Function STSetM (
               @p_point    geometry,
               @p_measure  float,
               @p_round_xy int = 3,
               @p_round_zm int = 2
             )
     Returns geometry

Description.

Function that adds/updates M ordinate of the supplied @p_point.

The updated coordinate’s XY ordinates are rounded to @p_round_xy number of decimal digits of precision.

The updated coordinate’s ZM ordinates are rounded to @p_round_ZM number of decimal digits of precision.

Notes.

Wrapper over STSetMeasure.

Parameters.

    @p_point     (geometry) - Supplied point geometry.
    @p_measure   (float)    - New M value.
    @p_round_xy  (int)      - Decimal degrees of precision to which calculated XY ordinates are rounded.
    @p_round_zm  (int)      - Decimal degrees of precision to which calculated ZM ordinates are rounded.

Result.

Returns input point with the measure value supplied by @p_measure.

Example.

select [lrs].[STSetM](
         geometry::STPointFromText (
           'POINT(0 0)',
           0
         ),
         1,
         3, 2 
       ).AsTextZM() as updatedPoint
go

updatedPoint
POINT(0 0 NULL 1)
Leave a Reply

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