Posted on

ST_Move

ST_Move This is a MySQL function which moves a geometry the supplied delta X and delta Y.

Function Specification.

    Function ST_Move (
                p_geometry geometry,
                p_dX       double,
                p_dY       double,
                p_round_xy int 
             )
     Returns geometry 

Description.

ST_Move is a function that moves the supplied geometry’s ordinates the supplied x and y deltas.

The computed ordinates of the new geometry are rounded to p_round_xy number of decimal digits of precision.

Parameters.

    p_geometry (geometry) - supplied geometry of any type.
    p_dX       (double)   - X ordinate delta shift.
    p_dy       (double)   - Y ordinate delta shift.
    p_round_xy (int)      - Decimal degrees of precision to which calculated XY ordinates are rounded.

Results.

The function moves the supplied geometry by supplied X and Y ordinate deltas.

Example.

    SELECT ST_AsText(
              ST_Move(
                 ST_GeomFromText('LINESTRING(0.1 0.2,1.4 45.2)',0),
                 -5.0, 30.1, 1
              )
           ) as movedGeom;

    # movedGeom
    'LINESTRING(-4.9 30.2,-3.6 31.5)'
Leave a Reply

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