Skip to content

[Bug] GDAL VRT with Int8 data type fail to import #4230

@ninsbl

Description

@ninsbl

Describe the bug

r.in.gdal and r.external fail to import GDAL Virtual Rasters (VRT) with Int8 datatype.
Int8 was relatively recently introduced to GDAL (3.7) and then made available in VRT datasets.
While GRASS GIS reads Int8 data in GeoTiff format, it fails with that datatype in VRT format.

To reproduce

# Create a Int8 raster in GeoTiff
gdal_create -ot Int8 -of GTiff -outsize 24 24 -burn 1 -a_srs EPSG:25833 -a_ullr 0 24 24 0 ./test.tif
# Create a VRT from it
gdal_translate -of VRT ./test.tif ./test.vrt
# Import the GeoTiff (works)
r.in.gdal -o input=test.tif output=test.tif
# Try to import the VRT (fails)
r.in.gdal -o input=test.vrt output=test.vrt
r.external -o input=test.vrt output=test.vrt

The last two commands fail with:

ERROR 1: Invalid dataType = Int8
ERROR: Unable to open datasource <test.vrt>

Expected behavior

GRASS GIS should import VRT with Int8 data.

System description

  • Ubuntu 22.04
  • GRASS GIS version: 8.4
  • GDAL 3.7

Additional context

GRASS GIS does not seem to be the only one here:
https://community.safe.com/data-7/int8-gdal-vrt-raster-not-supported-by-fme-18505

Metadata

Metadata

Assignees

No one assigned

    Labels

    CRelated code is in CbugSomething isn't workinglibrariesrasterRelated to raster data processing

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions