Returns a new geometry that is the result of applying the specified 3-D affine transformation.
geometry-expression.ST_Affine(a00,a01,a02,a10,a11,a12,a20,a21,a22,xoff,yoff,zoff)
Name | Type | Description |
---|---|---|
a00 |
DOUBLE |
The affine matrix element in row 0, column 0 |
a01 |
DOUBLE |
The affine matrix element in row 0, column 1 |
a02 |
DOUBLE |
The affine matrix element in row 0, column 2 |
a10 |
DOUBLE |
The affine matrix element in row 1, column 0 |
a11 |
DOUBLE |
The affine matrix element in row 1, column 1 |
a12 |
DOUBLE |
The affine matrix element in row 1, column 2 |
a20 |
DOUBLE |
The affine matrix element in row 2, column 0 |
a21 |
DOUBLE |
The affine matrix element in row 2, column 1 |
a22 |
DOUBLE |
The affine matrix element in row 2, column 2 |
xoff |
DOUBLE |
The x offset for translation |
yoff |
DOUBLE |
The y offset for translation |
zoff |
DOUBLE |
The z offset for translation |
ST_Geometry Returns a new geometry that is the result of the specified transformation.
The spatial reference system identifier of the result is the same as the spatial reference system of the geometry-expression.
An affine transformation combines rotation, translation and scaling into a single method call. The affine transform is defined using matrix multiplication.
For a point (x,y,z), the result (x',y',z') is computed as follows:
/ x' \ / a00 a01 a02 xoff \ / x \ | y' | = | a10 a11 a12 yoff | * | y | | z' | | a20 a21 a22 zoff | | z | \ w' / \ 0 0 0 1 / \ 1 / |
This method can not be used with geometries in round-Earth spatial reference system.
SQL/MM (ISO/IEC 13249-3: 2006) Vendor extension
The following returns the result LineString (5 6, 5 3, 9 3)
. The X values are translated by 5 and the Y values are translated by -1.
SELECT Shape.ST_Affine( 1,0,0, 0,1,0, 0,0,1, 5,-1,0 ) FROM SpatialShapes WHERE ShapeID = 5 |
The following returns the result LineString (.698833 6.965029, .399334 3.980017, 4.379351 3.580683)
. The Shape is rotated around the Z axis by 0.1 radians (about 5.7 degrees).
SELECT Shape.ST_Affine( cos(0.1),sin(0.1),0, -sin(0.1),cos(0.1),0, 0,0,1, 0,0,0 ) FROM SpatialShapes WHERE ShapeID = 5 |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |