<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">Le 13/10/2021 à 18:35, Eric Robeck a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAKa5cDLeMX6fPx8P59Yvdob=fTJq2npU7zCrc-Vee-Hy06uiQA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">I have a question about which GeoTIFF tags should
be used for storing CRS information. I have two GeoTIFFs: one
original and the same file saved as a COG. Then I created
gdalinfo and listgeo reports for each and compared them for
changes.
<div><br>
</div>
<div><b>gdalinfo</b>: Aside from the difference in the
PROJCRS citation ("WGS 84 / UTM zone 6N" vs.
"WGS_84_UTM_zone_6N"), the only change is the COG and LZW
predictor.</div>
<div><br>
</div>
<div><b>listgeo</b>: a large number of GeoTags were never
populated by the original GeoTIFF creators. Other ASCII
citation values were replaced by the Esri conversion tool.</div>
<div><br>
</div>
<div>A number of the listgeo-reported GeoKeys in the COG (e.g.
GeogGeodeticDatumGeoKey, GeogAngularUnitSizeGeoKey,
GeogEllipsoidGeoKey, etc.) are missing from the custom-made
original GeoTIFF. The extra CRS tags were added upon
conversion to COG. Those parameters are fundamental
components of the CRS and are reported in the gdalinfo WKT
as DATUM/ELLIPSOID, ANGLEUNIT, etc.</div>
<div><br>
</div>
<div>However, the WKT reported by gdalinfo is identical in
both cases. So it had access to the full WKT components even
when the corresponding GeoKeys were missing in the GeoTIFF.</div>
<div><br>
</div>
<div>My questions are: </div>
<div>
<ol>
<li style="margin-left:15px">If the GeoKeys storing that
information are missing from the GeoTIFF, where does
GDAL retrieve them from? Does it refer to the PROJ
library to retrieve the EPSG values for the EPSG codes
in ProjectedCSTypeGeoKey, VerticalCSTypeGeoKey, etc.?</li>
</ol>
</div>
</div>
</div>
</blockquote>
Yes, GDAL / libgeotiff uses the EPSG codes of the geokeys that
contain some to build its CRS object by querying the PROJ database.
If you've a ProjectedCSTypeGeoKey, then the geokeys describing the
linear unit, the geographic CRS, datum, etc are useless. When
outputing GeoTIFF 1.0, GDAL will write a bit more than needed. This
has been restricted to the minimum set to avoid any contradiction
when using GeoTIFF 1.1 output. GeoTIFF 1.0 is the default when no
vertical information is available. GeoTIFF 1.1 when there's one.
This can be controlled with the GEOTIFF_VERSION creation option.<br>
<blockquote type="cite"
cite="mid:CAKa5cDLeMX6fPx8P59Yvdob=fTJq2npU7zCrc-Vee-Hy06uiQA@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div>
<ol>
<li style="margin-left:15px">Some software, following
guidance in DGIWG-108 and DGIWG-250, did not assign a
VerticalDatumGeoKey. Prior to release of GeoTIFF 1.1,
the "unknown" value caused problems with vertical
projection in some software, like QT Modeler. Does GDAL
now fill in or assume the missing key based on the
VerticalCSTypeGeoKey?</li>
</ol>
</div>
</div>
</div>
</blockquote>
<p>If VerticalCSTypeGeoKey is present and the GeoTIFF version 1.0,
GDAL will use its rather complex heuristics to try to guess a
vertical CRS, but will not reoprt it by default unless you define
the GTIFF_REPORT_COMPD_CS=YES configuration option
(<a class="moz-txt-link-freetext" href="https://gdal.org/drivers/raster/gtiff.html#configuration-options">https://gdal.org/drivers/raster/gtiff.html#configuration-options</a>)</p>
<p>If the file is GeoTIFF 1.1, it will report the vertical
information by default, when present in the file.</p>
<p>Even<br>
</p>
<p><code class="decl_configoption docutils literal notranslate"><span
class="pre"></span></code></p>
<blockquote type="cite"
cite="mid:CAKa5cDLeMX6fPx8P59Yvdob=fTJq2npU7zCrc-Vee-Hy06uiQA@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div>Thanks in advance!</div>
<div><br>
</div>
<div>Regards,</div>
<div>Eric</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></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>