<div dir="ltr"><div dir="ltr">Thank you for all your quick answer. So the conclusion is I need a geogrid file to do it.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> ezt írta (időpont: 2020. ápr. 20., H, 12:06):<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 lundi 20 avril 2020 01:08:15 CEST jratike80 wrote:</p>
<p style="margin:0px;text-indent:0px">> Hi,</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> When it comes to gdalwarp I believe that this part of the documentation</p>
<p style="margin:0px;text-indent:0px">> <a href="https://gdal.org/programs/gdalwarp.html" target="_blank">https://gdal.org/programs/gdalwarp.html</a> is essential</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> "Starting with GDAL 2.2, if the SRS has an explicit vertical datum that</p>
<p style="margin:0px;text-indent:0px">> points to a PROJ.4 geoidgrids, and the input dataset is a single band</p>
<p style="margin:0px;text-indent:0px">> dataset, a vertical correction will be applied to the values of the</p>
<p style="margin:0px;text-indent:0px">> dataset."</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> Both EPSG:4326 and EPSG:2056 are 2D systems without explicit vertical datum.</p>
<p style="margin:0px;text-indent:0px">> EPSG:4979 is explicit 3D</p>
<p style="margin:0px;text-indent:0px">> <a href="http://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::4979" target="_blank">http://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::4979</a> and</p>
<p style="margin:0px;text-indent:0px">> the compound crs syntax that you used (-s_srs EPSG:2056+5728) is explicit as</p>
<p style="margin:0px;text-indent:0px">> well.</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> I do not know how gdaltransform knows to do the conversion in Z coordinate</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">As this is with GDAL 2, and likely PROJ 4 or 5, this was a change in ellipsoidal height between the WGS84 and Bessel 1841 ellipsoids, but this was highly questionable, and is no longer done in GDAL 3 / PROJ >= 6, at least when using 2D codes.</p></div></blockquote><div><br></div><div>We checked with GDAL 3, and you rignt. And the reason why gdaltransform result was close to the right value is because CHGeo2004 geoidal separation was close to 0 at the checked point.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-family:monospace;font-size:9pt;font-weight:400;font-style:normal">
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">> and how to give the -s_srs and -t_srs right for gdalwarp but I would try</p>
<p style="margin:0px;text-indent:0px">> next with</p>
<p style="margin:0px;text-indent:0px">> -s_srs EPSG:2056+5728 -t_srs epsg:4979</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">The change in Z done in gdalwarp requires:</p>
<p style="margin:0px;text-indent:0px">- single band dataset</p>
<p style="margin:0px;text-indent:0px">- input CRS is a geographic 3D CRS and output CRS is compound CRS (horizontal CRS + vertical CRS) with an explicit +geoidgrids term (or the reverse). The key here would be to have a vertical grid for EPSG:5728. I don't see any mentionned in EPSG. </p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">So provided that such grids is available, EPSG:2056+5728 would have to be replaced by "+init=epsg:2056 +geoidgrids=XXXXXX.gtx"</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>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div></div>