[gdal-dev] Codepage or UTF-8 in a metadata file Filename.aux in the Erdas Imagine format, describing a Filename.tif

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Mon Jun 26 04:57:58 PDT 2023


Hi,

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 https://trac.osgeo.org/gdal/ticket/2529.
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.
gdaladdo --config HFA_USE_RRD YES --config USE_RRD YES filename.tif
Best documentation about these configuration options is in https://gdal.org/drivers/raster/hfa.html

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.

-Jukka Rahkonen-

Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org> Puolesta Mikael Rittri
Lähetetty: maanantai 26. kesäkuuta 2023 12.44
Vastaanottaja: gdal-dev at lists.osgeo.org
Aihe: [gdal-dev] Codepage or UTF-8 in a metadata file Filename.aux in the Erdas Imagine format, describing a Filename.tif

Hello list.

I have encountered a Filename.tif with an associated metadata file, Filename.aux. The .aux file can be understood by gdalinfo, which says

Driver: HFA/Erdas Imagine Images (.img)
Files: Filename.aux
       Filename.rrd
       Filename.rde

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).

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.

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.

Best regards,

Mikael Rittri
Carmenta Geospatial Technologies
Sweden
carmenta.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230626/8e81c3da/attachment-0001.htm>


More information about the gdal-dev mailing list