0

I have 92 GeoTIFFs which vary subtantially in disk size, from around 60MB to 1.4GB rasters. I would like to build a mosaic of these slightly overlapping rasters, and I have read that one of the best options is using the gdalbuildvrt utility.

Well, I attempted that using the following command:

gdalbuildvrt -overwrite -allow_projection_difference -input_file_list FinalListing.txt FinalMosaic.vrt

Which outputs:

0...10...20...30...40...50...60...70..ERROR 1: SER002.19@ST00003A_STBD.tif:Failed to allocate memory for to read TIFF directory (0 elements of 20 bytes each)
ERROR 1: TIFFReadDirectory:Failed to read directory at offset 1454619608
.80...90...100 - done.

Note that SER002.19@ST00003A_STBD.tif is one the 92 files, and is listed in the FinalListing.txt file. The process seems to have failed on the file which has around 1.4 GB disk size. I remember some of the GDAL tools have a hard 1 GB limit (such as gdal_merge.py), but the gdalbuildvrt documentation does not mention this at all.

Is this the case or am I doing something wrong?

EDIT

This is the gdalinfo of the raster that interrupts the process.

gdalinfo SER002.19@ST00003A_STBD.tif
Driver: GTiff/GeoTIFF
Files: SER002.19@ST00003A_STBD.tif
Size is 248926, 320891
Coordinate System is:
BOUNDCRS[
    SOURCECRS[
        PROJCRS["SIRGAS 2000 / UTM zone 24S",
            BASEGEOGCRS["SIRGAS 2000",
                DATUM["Sistema de Referencia Geocentrico para las AmericaS 2000",
                    ELLIPSOID["GRS 1980",6378137,298.257222101,
                        LENGTHUNIT["metre",1]]],
                PRIMEM["Greenwich",0,
                    ANGLEUNIT["degree",0.0174532925199433]],
                ID["EPSG",4674]],
            CONVERSION["UTM zone 24S",
                METHOD["Transverse Mercator",
                    ID["EPSG",9807]],
                PARAMETER["Latitude of natural origin",0,
                    ANGLEUNIT["degree",0.0174532925199433],
                    ID["EPSG",8801]],
                PARAMETER["Longitude of natural origin",-39,
                    ANGLEUNIT["degree",0.0174532925199433],
                    ID["EPSG",8802]],
                PARAMETER["Scale factor at natural origin",0.9996,
                    SCALEUNIT["unity",1],
                    ID["EPSG",8805]],
                PARAMETER["False easting",500000,
                    LENGTHUNIT["metre",1],
                    ID["EPSG",8806]],
                PARAMETER["False northing",10000000,
                    LENGTHUNIT["metre",1],
                    ID["EPSG",8807]]],
            CS[Cartesian,2],
                AXIS["(E)",east,
                    ORDER[1],
                    LENGTHUNIT["metre",1]],
                AXIS["(N)",north,
                    ORDER[2],
                    LENGTHUNIT["metre",1]],
            USAGE[
                SCOPE["unknown"],
                AREA["Brazil - 42┬░W to 36┬░W"],
                BBOX[-26.35,-42,0.74,-36]],
            ID["EPSG",31984]]],
    TARGETCRS[
        GEOGCRS["WGS 84",
            DATUM["World Geodetic System 1984",
                ELLIPSOID["WGS 84",6378137,298.257223563,
                    LENGTHUNIT["metre",1]]],
            PRIMEM["Greenwich",0,
                ANGLEUNIT["degree",0.0174532925199433]],
            CS[ellipsoidal,2],
                AXIS["geodetic latitude (Lat)",north,
                    ORDER[1],
                    ANGLEUNIT["degree",0.0174532925199433]],
                AXIS["geodetic longitude (Lon)",east,
                    ORDER[2],
                    ANGLEUNIT["degree",0.0174532925199433]],
            USAGE[
                SCOPE["unknown"],
                AREA["World"],
                BBOX[-90,-180,90,180]],
            ID["EPSG",4326]]],
    ABRIDGEDTRANSFORMATION["Transformation to WGS84",
        METHOD["Position Vector transformation (geog2D domain)",
            ID["EPSG",9606]],
        PARAMETER["X-axis translation",0,
            ID["EPSG",8605]],
        PARAMETER["Y-axis translation",0,
            ID["EPSG",8606]],
        PARAMETER["Z-axis translation",0,
            ID["EPSG",8607]],
        PARAMETER["X-axis rotation",0,
            ID["EPSG",8608]],
        PARAMETER["Y-axis rotation",0,
            ID["EPSG",8609]],
        PARAMETER["Z-axis rotation",0,
            ID["EPSG",8610]],
        PARAMETER["Scale difference",1,
            ID["EPSG",8611]]]]
Data axis to CRS axis mapping: 1,2
Origin = (790096.750000000000000,8789367.149999998509884)
Pixel Size = (0.100000000000000,-0.099999999999999)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_DATETIME=2020:01:15 22:01:17
  TIFFTAG_SOFTWARE=CARIS++, v4.4.14
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
ERROR 1: SER002.19@ST00003A_STBD.tif:Failed to allocate memory for to read TIFF directory (0 elements of 20 bytes each)
ERROR 1: TIFFReadDirectory:Failed to read directory at offset 1454619608
Corner Coordinates:
Upper Left  (  790096.750, 8789367.150) ( 36d20'45.33"W, 10d56'24.38"S)
Lower Left  (  790096.750, 8757278.050) ( 36d20'35.91"W, 11d13'48.02"S)
Upper Right (  814989.350, 8789367.150) ( 36d 7' 6.15"W, 10d56'16.96"S)
Lower Right (  814989.350, 8757278.050) ( 36d 6'55.93"W, 11d13'40.39"S)
Center      (  802543.050, 8773322.600) ( 36d13'50.84"W, 11d 5' 2.52"S)
Band 1 Block=2048x2048 Type=Byte, ColorInterp=Red
  Description = Intensity
  Overviews: 124463x160446
  Mask Flags: PER_DATASET ALPHA
  Overviews of mask band: 124463x160446
  Metadata:
    Band_Name=Intensity
Band 2 Block=2048x2048 Type=Byte, ColorInterp=Green
  Description = Intensity
  Overviews: 124463x160446
  Mask Flags: PER_DATASET ALPHA
  Overviews of mask band: 124463x160446
  Metadata:
    Band_Name=Intensity
Band 3 Block=2048x2048 Type=Byte, ColorInterp=Blue
  Description = Intensity
  Overviews: 124463x160446
  Mask Flags: PER_DATASET ALPHA
  Overviews of mask band: 124463x160446
  Metadata:
    Band_Name=Intensity
Band 4 Block=2048x2048 Type=Byte, ColorInterp=Alpha
  Description = Intensity
  Overviews: 124463x160446
  Metadata:
    Band_Name=Intensity
2
  • Does gdalinfo SER002.19@ST00003A_STBD.tifsucceed? Can you convert it with gdal_translate -of GTiff -co tiled=yes -co compress=deflate SER002.19@ST00003A_STBD.tif test_copy.tif?
    – user30184
    Mar 12 '20 at 14:31
  • See my EDIT, with the gdalinfo output. I am currently running the deflate command.
    – jhc
    Mar 12 '20 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.