[postgis-users] Transforming WG84 to google Mercator and back

Christoph Handel christoph.handel at emporis.com
Wed Nov 26 09:38:58 PST 2008


Hi List,

i have troubles transforming from WGS84 to Googles Mercator and back.
On the commandline everthing is fine. 

WGS84 to google:

cs2cs +proj=latlong +datum=WGS84 +to +proj=merc +a=6378137 +b=6378137
+lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null
+no_defs
56 46
6233891.48	5780349.22 0.00

Reverse

cs2cs -I +proj=latlong +datum=WGS84 +to +proj=merc +a=6378137
+b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m
+nadgrids=@null +no_defs
6233891.48	5780349.22
56dE	46dN 0.000


same in postgres

forward

select st_astext(st_transform(geomfromtext('POINT(56
46)',4326),900913));
                st_astext                 
------------------------------------------
 POINT(6233891.48442332 5780349.22025635)


reverse

select st_astext(st_transform(geomfromtext('POINT(6233891.48442332
5780349.22025635)',900913),4326));
WARNING:  transform: -38 (failed to load NAD27-83 correction file)
                    st_astext                     
--------------------------------------------------
 POINT(8.77999328016943e-06 7.21213733809987e-06)
(1 row)


There is a posting in google (german):
http://groups.google.com/group/postgis-users/browse_thread/thread/158c4ea06d710010?hl=de&ie=UTF-8&q=ST_Transform+failed+to+load+NAD27-83+correction+file#e7adf1f4291550cd

Explaining that some files are missing on ubuntu. But as
transformation on the commandline are working that shouldn't be the
case.

all my packages are stock ubuntu 8.04.

proj: 4.6.0
postgresql: 8.3
postgis: 1.3.3

Did i miss something? Any hints?

Greetings
   Christoph
-- 

Christoph Handel
System Architect
IT Infrastructure and Operations


Emporis GmbH
Robert-Bosch-Strasse 7
64293 Darmstadt, Germany
Tel: +49 (0) 6151 50017 85
Fax: +49 (0) 6151 50017 99
Email: christoph.handel at emporis.com
Internet: http://corporate.emporis.com

Emporis is one of the world's leading providers of building-related
information.



More information about the postgis-users mailing list