Opened 10 years ago

Closed 10 years ago

#211 closed defect (wontfix)

Inverse transformation borks when fed +nadgrids=@null

Reported by: pramsey Owned by: mcayland
Priority: medium Milestone: PostGIS 1.3.7
Component: postgis Version: 1.3.X
Keywords: Cc:


Create the Google mercator system:

insert into spatial_ref_sys (srid, proj4text) values (900913, '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgrids=@nell +no_defs');

Then project into and out of it (it's the google->lonlat step that actually fails).

postgis13=# select st_astext(st_transform(st_transform('SRID=4326;POINT(-71.057810000000003 42.358919999999998)',900913),4326));
WARNING:  transform: -38 (failed to load NAD27-83 correction file)
 POINT(-1.11408409697064e-05 6.64126844571044e-06)
(1 row)

This is not a proj problem:

Heron-2:~ pramsey$ invproj +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgrids=@null +no_defs
-7910119.22608518 5214896.47356734
71d3'28.116"W	42d21'32.112"N

Nor does it manifest in 1.4.

Change History (5)

comment:1 Changed 10 years ago by pramsey

And if you remove the +nadgrids=@null from the proj4text, it works. The problem seems entirely bound to the invproj in the presence of +nadgrids=@null.

comment:2 Changed 10 years ago by mcayland

Works for me (correcting the small typo in your spatial_ref_sys proj4text above):

pg83@zeno:~/src/postgis-svn/1.3$ psql -d postgis13 Welcome to psql 8.3.5, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms

\h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit

postgis13=# insert into spatial_ref_sys (srid, proj4text) values (900913, '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgrids=@null +no_defs'); INSERT 0 1 postgis13=# select st_astext(st_transform(st_transform('SRID=4326;POINT(-71.057810000000003 42.358919999999998)',900913),4326));


POINT(-71.05781 42.35892)

(1 row)

postgis13=# select postgis_full_version();


POSTGIS="1.3.7SVN" GEOS="3.1.0-CAPI-1.5.0" PROJ="Rel. 4.6.1, 21 August 2008" USE_STATS

(1 row)




comment:3 Changed 10 years ago by pramsey

Curiouser and curiouser, I thought I had nailed down all the special things needed to make this happen. Try doing it on a system that has proj installed but not the extra nadgrids zip package. That's all that's left that's different I think.

comment:4 Changed 10 years ago by mcayland

Yeah; the logic in 1.3 was definitely wrong - see for more details which is why I reworked that section of the code for 1.4.

Given that changing this would cause changes in some reprojections that wouldn't be particularly easy to spot (we often get reports of people not even getting the grid files installed correctly), I don't think we should backpatch this to 1.3 :(



comment:5 Changed 10 years ago by pramsey

Resolution: wontfix
Status: newclosed

Fair enough, it's not like this issue hasn't existed forever anyways.

Note: See TracTickets for help on using tickets.