[postgis-users] Using grids transformation method with PostGis

Frank Warmerdam warmerdam at pobox.com
Tue Jun 8 09:54:00 PDT 2010


Luís de Sousa wrote:
> Hello everyone,
> 
> I'm trying to convert a series of spatial features from one SRS to
> another within PostGIS. Both are local systems for continental
> Portugal, for which a set of grid definition files have been made
> available by the University of Oporto. I downloaded these grid files
> and copied them into /usr/share/proj and /usr/local/share/proj. That
> was enough to get proj to start using them.
> 
> The problem is, when invoking the same transformation from PostGis I'm
> getting errors in the range of tenths, sometimes hundreds, of metres.
> It seems like PostGis is failing to use the grid files. In attachment
> goes a log demonstrating the same transformation having different
> results with proj and PostGis.
> 
> What am I missing? Is there any extra configuration needed for PostGis
> to use the grid files?

Luís,

I am unable to duplicate the results you are seeing in postgis, but
the differences are quite dramatic and I presume indicate that no
datum shift is being applied.  I can't think of any reason the grid shift
files would not be found if they are in the appropriate one of
/usr/local/share/proj and /usr/share/proj.

A few suggestions:

  * The +nadgrids= directive can include a full path if you want to be
    certain that path issues are not coming into play.

  * If you can ensure that the PROJ_DEBUG environment variable is set to
    some value before running the postgres server, you may well see proj
    debug output in the terminal window or log for the server.  This should
    include information on what grid shift files are picked up and used for
    transformations.

  * Your email did not make it clear what the definitions were for
    pt:dlxhg, +init=pt:pttm06 or what the proj4text for 3763 is in the
    database making it hard to see if the transform was the same as you
    did with cs2cs.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the postgis-users mailing list