12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>120 / 310and the vertices are transformed as follows:x’ = a*x + b*y + c*z + xoffy’ = d*x + e*y + f*z + yoffz’ = g*x + h*y + i*z + zoffAll of the translate / scale functions below are expressed via such an affine transformation.Version 2: Applies a 2d affine transformation to the geometry. The callST_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 /\ 0 0 0 1 /and the vertices are transformed as follows:x’ = a*x + b*y + xoffy’ = d*x + e*y + yoffz’ = zThis method is a subcase of the 3D method above.Availability: 1.1.2. Name changed from Affine to ST_Affine in 1.2.2NotePrior to 1.3.4, this function crashes if used with geometries that contain CURVES. This is fixed in 1.3.4+This function supports 3d and will not drop the z-index.This method supports Circular Strings and CurvesExamples--Rotate a 3d line 180 degrees about the z axis. Note this is long-hand for doing ←↪ST_RotateZ();SELECT ST_AsEWKT(ST_Affine(the_geom, cos(pi()), -sin(pi()), 0, sin(pi()), cos(pi()), 0, ←↪0, 0, 1, 0, 0, 0)) As using_affine,ST_AsEWKT(ST_RotateZ(the_geom, pi())) As using_rotatezFROM (SELECT ST_GeomFromEWKT(’LINESTRING(1 2 3, 1 4 3)’) As the_geom) As foo;using_affine | using_rotatez-----------------------------+-----------------------------LINESTRING(-1 -2 3,-1 -4 3) | LINESTRING(-1 -2 3,-1 -4 3)(1 row)--Rotate a 3d line 180 degrees in both the x and z axisSELECT ST_AsEWKT(ST_Affine(the_geom, cos(pi()), -sin(pi()), 0, sin(pi()), cos(pi()), -sin( ←↪pi()), 0, sin(pi()), cos(pi()), 0, 0, 0))FROM (SELECT ST_GeomFromEWKT(’LINESTRING(1 2 3, 1 4 3)’) As the_geom) As foo;st_asewkt-------------------------------LINESTRING(-1 -2 -3,-1 -4 -3)(1 row)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!