From: Regina Obe Date: Sun, 26 Oct 2008 19:43:24 +0000 (+0000) Subject: Move over rest of Affine family. Correct some typos. Put ST_ForceRHR in right location. X-Git-Tag: 1.4.0b1~583 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=462d51e5d7d851708ec886d563388d66b8b376c2;p=postgis Move over rest of Affine family. Correct some typos. Put ST_ForceRHR in right location. git-svn-id: http://svn.osgeo.org/postgis/trunk@3178 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference.xml b/doc/reference.xml index ffe827b87..1245d8bf4 100644 --- a/doc/reference.xml +++ b/doc/reference.xml @@ -600,48 +600,6 @@ Forces the geometries into XYZM mode. - - - ST_Scale(geometry, float8, float8, float8) - - - scales the geometry to a new size by multiplying the - ordinates with the parameters. Ie: scale(geom, Xfactor, Yfactor, - Zfactor). - - Availability: 1.1.0 - - - - - ST_RotateZ(geometry, float8) - - ST_RotateX(geometry, float8) - - ST_RotateY(geometry, float8) - - - Rotate the geometry around the Z, X or Y axis by the given - angle given in radians. Follows the right-hand rule. - - Availability: 1.1.2. - - - - - ST_TransScale(geometry, float8, float8, float8, float8) - - - First, translates the geometry using the first two floats, - then scales it using the second two floats, working in 2D only. - Using transscale(geom, X, Y, XFactor, YFactor) - internally calls affine(geom, XFactor, 0, 0, 0, YFactor, 0, - 0, 0, 1, X*XFactor, Y*YFactor, 0). - - Availability: 1.1.0. - - - diff --git a/doc/reference_new.xml b/doc/reference_new.xml index eb930f84a..4c8cfd857 100644 --- a/doc/reference_new.xml +++ b/doc/reference_new.xml @@ -3677,8 +3677,8 @@ y' = d*x + e*y + f*z + yoff z' = g*x + h*y + i*z + zoff All of the translate / scale functions below are expressed via such an affine transformation. - Version 2: Applies an 2d affine transformation to the geometry. The - call Affine(geom, a, b, d, e, xoff, yoff) + Version 2: Applies a 2d affine transformation to the geometry. The + call ST_Affine(geom, a, b, d, e, xoff, yoff) represents the transformation matrix / a b 0 xoff \ / a b xoff \ | d e 0 yoff | rsp. | d e yoff | | 0 0 1 0 | \ 0 0 1 / @@ -3729,6 +3729,67 @@ SELECT ST_AsEWKT(ST_Affine(the_geom, cos(pi()), -sin(pi()), 0, sin(pi()), cos(pi , , , + + + + ST_ForceRHR + + Forces the orientation of the vertices in a polygon to follow the + Right-Hand-Rule. + + + + + + boolean + ST_ForceRHR + + geometry + + g + + + + + + Description + + Forces the orientation of the vertices in a polygon to follow the + Right-Hand-Rule. In GIS terminology, this means that the area that is bounded by the + polygon is to the right of the boundary. In particular, the exterior ring is + orientated in a clockwise direction and the interior rings in a counter-clockwise + direction. + + + + + + This function supports 3d in that it will not drop the + z-index. + + + + Examples + + SELECT ST_AsEWKT( + ST_ForceRHR( + 'POLYGON((0 0 2, 5 0 2, 0 5 2, 0 0 2),(1 1 2, 1 3 2, 3 1 2, 1 1 2))' + ) +); + st_asewkt +-------------------------------------------------------------- + POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 3 2,1 1 2)) +(1 row) + + + + See Also + + , + , + + + @@ -3910,6 +3971,292 @@ LINESTRING(1 2,1 10) | LINESTRING(1 10,1 2) + + + + ST_Rotate + + This is a synonym for ST_RotateZ + + + + + + geometry ST_Rotate + geometry geomA + float rotZRadians + + + + + + Description + + This is a synonym for ST_RotateZ.. Rotates geometry rotZRadians about the Z-axis. + + + + + + + This function supports 3d and will not drop the z-index. + + + + + Examples + + + + + + + See Also + + , , , + + + + + + ST_RotateX + + Rotate a geometry rotRadians about the X axis. + + + + + + geometry ST_RotateX + geometry geomA + float rotRadians + + + + + + Description + + Rotate a geometry geomA - rotRadians about the X axis. + + ST_RotateX(geomA, rotRadians) + is short-hand for ST_Affine(geomA, 1, 0, 0, 0, cos(rotRadians), -sin(rotRadians), 0, sin(rotRadians), cos(rotRadians), 0, 0, 0). + + + + + + + This function supports 3d and will not drop the z-index. + + + + + Examples + + +--Rotate a line 90 degrees along x-axis +SELECT ST_AsEWKT(ST_RotateX(ST_GeomFromEWKT('LINESTRING(1 2 3, 1 1 1)'), pi()/2)); + st_asewkt +--------------------------- + LINESTRING(1 -3 2,1 -1 1) + + + + + + See Also + + , , + + + + + + ST_RotateY + + Rotate a geometry rotRadians about the Y axis. + + + + + + geometry ST_RotateY + geometry geomA + float rotRadians + + + + + + Description + + Rotate a geometry geomA - rotRadians about the y axis. + + ST_RotateY(geomA, rotRadians) + is short-hand for ST_Affine(geomA, cos(rotRadians), 0, sin(rotRadians), 0, 1, 0, -sin(rotRadians), 0, cos(rotRadians), 0, 0, 0). + + + + + + + This function supports 3d and will not drop the z-index. + + + + + Examples + + +--Rotate a line 90 degrees along y-axis + SELECT ST_AsEWKT(ST_RotateY(ST_GeomFromEWKT('LINESTRING(1 2 3, 1 1 1)'), pi()/2)); + st_asewkt +--------------------------- + LINESTRING(3 2 -1,1 1 -1) + + + + + + See Also + + , , , Rotate around Point, Create Ellipse functions + + + + + + ST_RotateZ + + Rotate a geometry rotRadians about the Z axis. + + + + + + geometry ST_RotateZ + geometry geomA + float rotRadians + + + + + + Description + + Rotate a geometry geomA - rotRadians about the Z axis. + + ST_RotateZ(geomA, rotRadians) + is short-hand for SELECT ST_Affine(geomA, cos(rotRadians), -sin(rotRadians), 0, sin(rotRadians), cos(rotRadians), 0, 0, 0, 1, 0, 0, 0). + + + + + + + This function supports 3d and will not drop the z-index. + + + + + Examples + + +--Rotate a line 90 degrees along z-axis +SELECT ST_AsEWKT(ST_RotateZ(ST_GeomFromEWKT('LINESTRING(1 2 3, 1 1 1)'), pi()/2)); + st_asewkt +--------------------------- + LINESTRING(-2 1 3,-1 1 1) + + + + + + See Also + + , , , Rotate around Point, Create Ellipse functions + + + + + + ST_Scale + + Scales the geometry to a new size by multiplying the + ordinates with the parameters. Ie: ST_Scale(geom, Xfactor, Yfactor, + Zfactor). + + + + + + + geometry ST_Scale + geometry geomA + float XFactor + float YFactor + float ZFactor + + + + geometry ST_Scale + geometry geomA + float XFactor + float YFactor + + + + + + Description + + Scales the geometry to a new size by multiplying the + ordinates with the parameters. Ie: ST_Scale(geom, Xfactor, Yfactor, + Zfactor). + + ST_Scale(geomA, XFactor, YFactor, ZFactor) + is short-hand for ST_Affine(geomA, XFactor, 0, 0, 0, YFactor, 0, 0, 0, ZFactor, 0, 0, 0). + + + Availability: 1.1.0. + + + + + + This function supports 3d and will not drop the z-index. + + + + + Examples + + --Version 1: scale X, Y, Z +SELECT ST_AsEWKT(ST_Scale(ST_GeomFromEWKT('LINESTRING(1 2 3, 1 1 1)'), 0.5, 0.75, 0.8)); + st_asewkt +-------------------------------------- + LINESTRING(0.5 1.5 2.4,0.5 0.75 0.8) + +--Version 2: Scale X Y + SELECT ST_AsEWKT(ST_Scale(ST_GeomFromEWKT('LINESTRING(1 2 3, 1 1 1)'), 0.5, 0.75)); + st_asewkt +---------------------------------- + LINESTRING(0.5 1.5 3,0.5 0.75 1) + + + + + + + + See Also + + , + + @@ -4360,71 +4707,73 @@ CREATE INDEX idx_the_geom_26986_parcels See Also - , + , , - - - - ST_ForceRHR - - Forces the orientation of the vertices in a polygon to follow the - Right-Hand-Rule. - - - - - - boolean - ST_ForceRHR - - geometry - - g - - - - - - Description - - Forces the orientation of the vertices in a polygon to follow the - Right-Hand-Rule. In GIS terminology, this means that the area that is bounded by the - polygon is to the right of the boundary. In particular, the exterior ring is - orientated in a clockwise direction and the interior rings in a counter-clockwise - direction. - - - - - - This function supports 3d in that it will not drop the - z-index. - - - - Examples - SELECT ST_AsEWKT( - ST_ForceRHR( - 'POLYGON((0 0 2, 5 0 2, 0 5 2, 0 0 2),(1 1 2, 1 3 2, 3 1 2, 1 1 2))' - ) -); - st_asewkt --------------------------------------------------------------- - POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 3 2,1 1 2)) -(1 row) - - - - See Also - - , - , - - + + + ST_TransScale + + Translates the geometry using the deltaX and deltaY args, + then scales it using the XFactor, YFactor args, working in 2D only. + + + + + + + geometry ST_TransScale + geometry geomA + float deltaX + float deltaY + float XFactor + float YFactor + + + + + + Description + + Translates the geometry using the deltaX and deltaY args, + then scales it using the XFactor, YFactor args, working in 2D only. + + ST_TransScale(geomA, deltaX, deltaY, XFactor, YFactor) + is short-hand for ST_Affine(geomA, XFactor, 0, 0, 0, YFactor, 0, + 0, 0, 1, deltaX*XFactor, deltaY*YFactor, 0). + + + Availability: 1.1.0. + + + + + + This function supports 3d and will not drop the z-index. + + + + + Examples + + SELECT ST_AsEWKT(ST_TransScale(ST_GeomFromEWKT('LINESTRING(1 2 3, 1 1 1)'), 0.5, 1, 1, 2)); + st_asewkt +----------------------------- + LINESTRING(1.5 6 3,1.5 4 1) + + + + + + See Also + + , + + +