<div dir="ltr">Thanks Even, really helpful!<div><br></div><div>Patrick</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 16, 2020 at 3:45 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div style="font-family:monospace;font-size:9pt;font-weight:400;font-style:normal">
<p style="margin:0px;text-indent:0px">On mardi 16 juin 2020 15:17:54 CEST Patrick Young wrote:</p>
<p style="margin:0px;text-indent:0px">> Is this a special case for EPSG:5773, or is it a bad idea to express the</p>
<p style="margin:0px;text-indent:0px">> vertical datum via EPSG codes in general?</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">This could go in a lengthy geodesy lesson, but bascially a CRS definition and its transformation to another one are two separate concepts. PROJ < 6 tended to blend them together, by including the transformation to WGS84 in the CRS definition. For number of cases, this is accurate enough, but this systematic use of WGS84 pivot is more and more wrong in a number of situations, hence this is no longer used systematically in PROJ 6. PROJ < 6 behaviour was a "early binding" (to WGS84), while PROJ 6 uses a "late binding" approach where it might use a WGS84 pivot, or another one, or a direct transformation when available</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Some details about that in:</p>
<p style="margin:0px;text-indent:0px"><a href="http://download.osgeo.org/proj/presentations/PROJ%20CRS%20revamp%20(FOSS4G%202019).pdf" target="_blank">http://download.osgeo.org/proj/presentations/PROJ%20CRS%20revamp%20(FOSS4G%202019).pdf</a></p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">So by adding +geoidgrids=egm96_15.gtx you force the geoid to be referenced to WGS84. Which makes sense in this particular case, since indeed EGM96 height has a transformation to WGS84, but not in the general case.</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">The current approach used by gdalwarp to do those height correction is a bit of a "hack". A more generalized approach would use PROJ capabilities to compute the Z difference without GDAL to have to explicitly use the geoidgrid.</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Even</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">-- </p>
<p style="margin:0px;text-indent:0px">Spatialys - Geospatial professional services</p>
<p style="margin:0px;text-indent:0px"><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a></p></div></blockquote></div>