You are on page 1of 2

PostGIS 1.5.

1 Manual
140 / 315

+nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat,null

The null grid shift file is a valid grid shift file covering the whole world and applying no shift. So for a complete example, if you
wanted to alter PostGIS so that transformations to SRID 4267 that didnt lie within the correct range did not throw an ERROR,
you would use the following:
UPDATE spatial_ref_sys SET proj4text = +proj=longlat +ellps=clrk66 +nadgrids=@conus, @alaska,@ntv2_0.gsb,@ntv1_can.dat,null +no_defs WHERE srid = 4267;

See Also
PostGIS_Full_Version, ST_AsText, ST_SetSRID, UpdateGeometrySRID

7.5.25 ST_Translate
Name
ST_Translate Translates the geometry to a new location using the numeric parameters as offsets. Ie: ST_Translate(geom, X,
Y) or ST_Translate(geom, X, Y,Z).

Synopsis
geometry ST_Translate(geometry g1, float deltax, float deltay);
geometry ST_Translate(geometry g1, float deltax, float deltay, float deltaz);

Description
Returns a new geometry whose coordinates are translated delta x,delta y,delta z units. Units are based on the units defined in
spatial reference (SRID) for this geometry.

Note
Prior to 1.3.4, this function crashes if used with geometries that contain CURVES. This is fixed in 1.3.4+

Availability: 1.2.2
This function supports 3d and will not drop the z-index.
This method supports Circular Strings and Curves

Examples
Move a point 1 degree longitude
SELECT ST_AsText(ST_Translate(ST_GeomFromText(POINT(-71.01 42.37),4326),1,0)) As
wgs_transgeomtxt;
wgs_transgeomtxt
--------------------POINT(-70.01 42.37)

PostGIS 1.5.1 Manual


141 / 315

Move a linestring 1 degree longitude and 1/2 degree latitude


SELECT ST_AsText(ST_Translate(ST_GeomFromText(LINESTRING(-71.01 42.37,-71.11 42.38),4326) ,1,0.5)) As wgs_transgeomtxt;
wgs_transgeomtxt
--------------------------------------LINESTRING(-70.01 42.87,-70.11 42.88)

Move a 3d point
SELECT ST_AsEWKT(ST_Translate(CAST(POINT(0 0 0) As geometry), 5, 12,3));
st_asewkt
--------POINT(5 12 3)

Move a curve and a point

SELECT ST_AsText(ST_Translate(ST_Collect(CURVEPOLYGON(CIRCULARSTRING(4 3,3.12 0.878,1 0,-1.121 5.1213,6 7, 8 9,4 3)),POINT(1 3)),1,2));


st_astext
----------------------------------------------------------------------------------------------------GEOMETRYCOLLECTION(CURVEPOLYGON(CIRCULARSTRING(5 5,4.12 2.878,2 2,-0.121 7.1213,7 9,9 11,5 5)),POINT(2 5))

See Also
ST_Affine, ST_AsText, ST_GeomFromText

7.5.26 ST_TransScale
Name
ST_TransScale Translates the geometry using the deltaX and deltaY args, then scales it using the XFactor, YFactor args,
working in 2D only.

Synopsis
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.
Note

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).

Note
Prior to 1.3.4, this function crashes if used with geometries that contain CURVES. This is fixed in 1.3.4+

You might also like