[Proj] PROJ.4 4.9.2 and transformation of points outside datum shift grid
Even Rouault
even.rouault at spatialys.com
Tue Feb 2 05:11:34 PST 2016
Le mardi 02 février 2016 11:52:52, Even Rouault a écrit :
> Hi Bas,
>
> Reverting
> https://github.com/OSGeo/proj.4/commit/5d2af3a8 on top of current master
> didn't change the behaviour and still resulted in the vertical grid being
> (erroneously) applied as in official 4.9.2. The reason is that cs2cs.c
> always calls pj_transform() with a non-null z pointer (z=0 if not
> specified), so this changeset has no effect on that.
>
> Investigating more, I found the following commit to be the cause :
> https://github.com/OSGeo/proj.4/commit/338ea581
> " apply patch from #271 to use GTX null value 88.88880f for vertical
> shifts" (message should read -88.88880f by the way to reflect the code)
>
> Looking at the grid (downloaded from
> https://github.com/NaturalGIS/ntv2_transformations_grids_and_sample_data/bl
> ob/master/nl/naptrans2008.gtx ), it appears it doesn't use the official
> null value -88.88880f but various big negative values like -2147479936,
> -2147479808 and several others as well.
>
> So I think we need probably a mix of both codes for wider compatibility.
> Something like :
>
> /* nodata? */
> /* GTX official nodata value if -88.88880f, but some grids also use other
> */ /* big values for nodata (e.g naptrans2008.gtx has nodata values like
> /* -2147479936), so test them too */
> if( value > 1000 || value < -1000 || value == -88.88880f )
>
> Checking >1000 or <-1000 is somewhat arbitrary, but I'm not aware of vgrids
> that have such big offsets (at least on Earth), so it is likely safe. The
> original ticket https://github.com/OSGeo/proj.4/issues/271 doesn't report
> that they can cause problems in practice.
>
> Howard ?
I've prepared https://github.com/OSGeo/proj.4/pull/349 with above fix
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the Proj
mailing list