<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
        {font-family:"Segoe UI Semibold";
        panose-1:2 11 7 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-ligatures:standardcontextual;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.Shkpostityyli21
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:75245736;
        mso-list-type:hybrid;
        mso-list-template-ids:1836728436 1029468182 67829763 67829765 67829761 67829763 67829765 67829761 67829763 67829765;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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]-->
</head>
<body lang="FI" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I cannot say anything about the codebase in the Erdas .aux file, but it looks that by running “gdalinfo filename.aux” you are doing something that you are not expected to do. See some background from
<a href="https://trac.osgeo.org/gdal/ticket/2529">https://trac.osgeo.org/gdal/ticket/2529</a>.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I am not sure what all is required for getting a set of filename.tif, filename.aux, filename.rrd, and filename.rde. Having .rde means that the overviews take more than 2 GB and they do not fit into .rrd (or .aux). That
 there exists both .aux and .rrd may mean that the GeoTIFF is created by some ESRI tool. With GDAL it requires this odd command to force the creation of both .aux and .rrd.<br>
gdaladdo --config HFA_USE_RRD YES --config USE_RRD YES filename.tif<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best documentation about these configuration options is in
<a href="https://gdal.org/drivers/raster/hfa.html">https://gdal.org/drivers/raster/hfa.html</a>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">You wrote “The .aux file can be understood by gdalinfo” and that is partially true. However, “gdalinfo filename.aux” gives information only from the overviews. Read the output and you’ll see that CRS info is missing.
 The right command is “gdalinfo filename.tif” and it is then searching info from the tif file and all the sidecar files.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="mso-ligatures:none;mso-fareast-language:FI">Lähettäjä:</span></b><span style="mso-ligatures:none;mso-fareast-language:FI"> gdal-dev <gdal-dev-bounces@lists.osgeo.org>
<b>Puolesta </b>Mikael Rittri<br>
<b>Lähetetty:</b> maanantai 26. kesäkuuta 2023 12.44<br>
<b>Vastaanottaja:</b> gdal-dev@lists.osgeo.org<br>
<b>Aihe:</b> [gdal-dev] Codepage or UTF-8 in a metadata file Filename.aux in the Erdas Imagine format, describing a Filename.tif<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif">Hello list.
<br>
<br>
I have encountered a Filename.tif with an associated metadata file, Filename.aux. The .aux file can be understood by gdalinfo, which says<br>
<br>
</span><span lang="EN-GB" style="font-family:"Courier New"">Driver: HFA/Erdas Imagine Images (.img)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">Files: Filename.aux<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">       Filename.rrd<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">       Filename.rde
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif">As I understand it, the .aux file is on an Erdas Imagine format intended to describe metadata for the Erdas .img format, but it can also be used to describe metadata for .tif
 files as in my case. (I have the Filename.rrd and the Filename.rde but not any Filename.img, so it is somewhat strange but useful that GDAL can read the .aux file directly).
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif">Anyway, my question is: when the Filename.aux contains strings, in my case descriptions of terrain types represented by integers (part of a Raster Attribute Table), is there an
 established way to figure out whether the strings are stored in UTF-8, or if not, what codepage is used? In my case, the strings seem to be stored as 8-bit ASCII using the codepage 1252 (mainly for West-European alphabets), but GDAL seems to expect UTF-8 so
 the Swedish characters with diacritics become garbled. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif">I realize that if the .aux format is proprietary and has just been reverse-engineered, then maybe no-one knows the answer to this. But I am curious if anyone has had similar problems
 and maybe figured out a workaround. Or if there are any grounds to say that UTF-8 is mandatory in the .aux format, then my example file would be incorrect and that would also be useful to know.
<br>
<br>
Best regards, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Segoe UI Semibold",sans-serif;color:#D18765;mso-ligatures:none;mso-fareast-language:#2000">Mikael Rittri</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#D18765;mso-ligatures:none;mso-fareast-language:#2000"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:8.0pt;font-family:"Segoe UI Semibold",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000">Carmenta Geospatial Technologies<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:8.0pt;font-family:"Segoe UI Semibold",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000">Sweden</span><span lang="EN-US" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Segoe UI",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000">carmenta.com<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-ligatures:none;mso-fareast-language:#2000"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>