<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Chris,</p>
<p>Please file a ticket about that at
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/issues/new">https://github.com/OSGeo/gdal/issues/new</a> <br>
</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 08/06/2022 à 09:11, Chris Smemoe via
gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:000001d87b06$fc686570$f5393050$@aquaveo.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style>@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">I’m not sure whether this is a bug or some
issue with how I’m doing things (like maybe my WKT is bogus),
but when I try to define a compound projection for a GeoTIFF
with a local projection, the vertical projection information
does not get saved to the GeoTIFF and I get an error reported
from PROJ. I am trying to upgrade the version of GDAL I’m
using and I think this used to work in GDAL version 2.x but no
longer works in GDAL 3.x/PROJ 7.x. What I’m trying to do is
to update the projection of a GeoTIFF from a local projection
with horizontal units only to a compound projection with both
horizontal and vertical units. When I close the GDAL dataset,
It seems like PROJ is trying to look for an ellipsoid node for
the spatial reference object but I don’t have one since I’m
using a local projection. Then when I reopen the dataset,
nothing seems to have been saved. I’m running GDAL 3.4.2.
Here’s an example of what I’m trying to do:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-------------------begin-------------------<o:p></o:p></p>
<p class="MsoNormal">python<o:p></o:p></p>
<p class="MsoNormal">>>> from osgeo import gdal<o:p></o:p></p>
<p class="MsoNormal">>>> gd =
gdal.Open("C:\\temp\\grid_meter_exported.tif", gdal.GA_Update)<o:p></o:p></p>
<p class="MsoNormal">>>> gd<o:p></o:p></p>
<p class="MsoNormal"><osgeo.gdal.Dataset; proxy of <Swig
Object of type 'GDALDatasetShadow *' at 0x000001B6BC578630>
><o:p></o:p></p>
<p class="MsoNormal">>>> gd.GetProjectionRef()<o:p></o:p></p>
<p class="MsoNormal">'LOCAL_CS["None",UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'<o:p></o:p></p>
<p class="MsoNormal">>>>
gd.SetProjection('COMPD_CS["None",LOCAL_CS["None",LOCAL_DATUM["None",32767],UNIT["Foot_US",0.304800609601219],AXIS["None",OTHER]],VERT_CS["Local
Meter",VERT_DATUM["Local",2005],UNIT["Meter",1,AUTHORITY["EPSG","9001"]],AXIS["Gravity-related
height",UP]]]')<o:p></o:p></p>
<p class="MsoNormal">0<o:p></o:p></p>
<p class="MsoNormal">>>> gd.GetProjection()<o:p></o:p></p>
<p class="MsoNormal">'COMPD_CS["None",LOCAL_CS["None",LOCAL_DATUM["None",32767],UNIT["Foot_US",0.304800609601219],AXIS["None",OTHER]],VERT_CS["Local
Meter",VERT_DATUM["Local",2005],UNIT["Meter",1,AUTHORITY["EPSG","9001"]],AXIS["Gravity-related
height",UP]]]'<o:p></o:p></p>
<p class="MsoNormal">>>> gd = None<o:p></o:p></p>
<p class="MsoNormal"><span style="color:red">ERROR 1: PROJ:
proj_get_ellipsoid: CRS has no geodetic CRS<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red">ERROR 1: PROJ:
proj_get_ellipsoid: Object is not a CRS or
GeodeticReferenceFrame<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red">ERROR 1: PROJ:
proj_get_ellipsoid: CRS has no geodetic CRS<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red">ERROR 1: PROJ:
proj_get_ellipsoid: Object is not a CRS or
GeodeticReferenceFrame<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red">ERROR 1: PROJ:
proj_crs_get_geodetic_crs: CRS has no geodetic CRS<o:p></o:p></span></p>
<p class="MsoNormal">>>> gd =
gdal.Open("C:\\temp\\grid_meter_exported.tif", gdal.GA_Update)<o:p></o:p></p>
<p class="MsoNormal">>>> gd<o:p></o:p></p>
<p class="MsoNormal"><osgeo.gdal.Dataset; proxy of <Swig
Object of type 'GDALDatasetShadow *' at 0x000001B6BC578720>
><o:p></o:p></p>
<p class="MsoNormal">>>> gd.GetProjectionRef()<o:p></o:p></p>
<p class="MsoNormal">'LOCAL_CS["None",UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-------------------end-------------------<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The dataset I’m working with can be
downloaded here:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a
href="https://www.dropbox.com/s/2jn7vkcl690e90r/grid_meter_exported.tif?dl=1"
moz-do-not-send="true" class="moz-txt-link-freetext">https://www.dropbox.com/s/2jn7vkcl690e90r/grid_meter_exported.tif?dl=1</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’d appreciate any guidance.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Chris<o:p></o:p></p>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>