[PROJ] Vertical CRS transformations and vertical grid shift

Even Rouault even.rouault at spatialys.com
Thu Apr 16 09:26:20 PDT 2020


> Final question (sorry about that):
> Are you aware of any involvement of this kind of reprojection in gdal_warp
> processing?
> I mean, I just did a test by building PROJ master and GDAL 3.1 against that
> PROJ version and tried a
> 
> gdalwarp -s_srs "EPSG:31255+5778" -t_srs "EPSG:3035+9274" dem.tif
> warpeddem.tif
> 
> Is it expected to reproject the DEM values? :-)

No. Well, this is a bit more complicated than this simple "no". There is actually a special case 
in GDAL mentionned in
https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-t-srs :
"Starting with GDAL 2.2, if the SRS has an explicit vertical datum that points to a PROJ.4 
geoidgrids, and the input dataset is a single band dataset, a vertical correction will be applied 
to the values of the dataset."

But this was in a pre PROJ 6 era, and geoidgrids are no longer used when expanding EPSG 
codes (for good reasons). So you would need to provide an explicit PROJ.4 string to make 
that work. And this would only work between a geographic 3D CRS and a compoundCRS, not 
between two compound CRS like this use case.

So in that use case, you'd have for example to reproject the height shift grid itself to the 
same bounds and resolution of the target raster, and use gdal_calc for example to apply the 
shift.

I had a discussion a few months ago with someone interested in this GDAL 2.2 behaviour to 
work with PROJ 6, but that didn't go further.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20200416/4686dffb/attachment.html>


More information about the PROJ mailing list