[postgis-users] Datum Shift Problems with PostGIS

René F. Viancos S. rviancos at gmail.com
Fri Mar 10 12:31:07 PST 2006

Datum shift Problems with PostGIS

Dear List Users, In order to make datum change with proj from command line,
i have the following example that works fine.

Datum Change from Sad69/utm 19s to wgs84/utm 19s

# cs2cs +proj=utm +zone=19 +south +ellps=GRS67 +towgs84=-75,-1,-44 +unit=m
+to +proj=utm +zone=19 +south +datum=WGS84

In Order to make the same procces, but using Postgis we have added a record
en the spatial_ref_sys table, with a custom epsg code to get a personalized
transformation, and in en the proj4text field the following sentence (like
the parameters of cs2cs) has been added.

Record added to spatial_ref_sys Table

srid : 50000
auth_name : EPSG
auth_srid: 50000
srtext : Sad69 a wgs84
proj4text : +proj=utm +zone=19 +south +ellps=GRS67 +towgs84=75,1,44 +unit=m
+to +proj=utm +zone=19 +south +datum=WGS84 +no_defs

To run this custom datum transformation we use the transform() function
build in a query inserted as parameter in the pgsql2shp command.

pgsql2shp -h localhost -p 5432 -u pgsql -P pgsql -f shapefile_name.shp
"select transform(setsrid(the_geom,29179),50000) as the_geom from

(we have our cartography with SRID=-1, reason why we use the setsrid

we get a shapefile correctly transformed to wgs84/utm 19s Datum

Here is the first Question: Why we need to change the sign in the
transformation parameters, +towgs84=-75,-1,-44 in command line and
+towgs84=75,1,44 in the proj4text fiel of the spatial_ref_sys table ?????

we had many problems with this, we solve it, but we don't know why we need
to change it if postgis works with proj.

Now, we try to make the inverse process, in order to make a datum shift from
WGS84 utm 19s to sad69 utm 19s, and the proj documentation tells that the -I
parameter is the only that we need to make the inverse datum shift. With
cs2cs command the -I parameter works fine, but the inclusion of this
parameter in the proj4text field in the spatial_ref_sys table does not make
a correct transformation, giving us around 1000 meters of displacement.

Second Question: How can we make this inverse transformation with postgis
(wgs84 to psad56) ?

Jaime H. Villanueva A.
Ingeniero Geomensor.
Cel: (56-9) 9423810

René F. Viáncos S.
Director de Geomática y TIC
Vicerrectoría de Investigación y Desarrollo
Universidad de Chile
Tel (56-2) 632 62 09
Cel (56 9) 933 72 66
rviancos at uchile.cl
rviancos at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060310/53c81fa0/attachment.html>

More information about the postgis-users mailing list