0

Preface: I am fairly new to GIS, and as such - I haven't wrapped my head around the terms. I'm trying to vertically concatenate several tall JPEG-in-TIFF files into a single file. I've attempted using a combination of gdal_create followed by gdalwarp, but this results in the TIFF files being layered over each other at the start of the final image, rather than being appended end-to-end as intended. My goal is to achieve this concatenation using command line tools, without compromising the original images' quality or metadata.

Here's an example of the gdalinfo output of 1 of the files:

gdalinfo 1.tiff
Driver: GTiff/GeoTIFF
Files: 1.tiff
Size is 523, 771030
Metadata:
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_XRESOLUTION=25.4
  TIFFTAG_YRESOLUTION=25.4
Image Structure Metadata:
  COMPRESSION=JPEG
  INTERLEAVE=PIXEL
  JPEGTABLESMODE=1
  JPEG_QUALITY=100
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,771030.0)
Upper Right (  523.0,    0.0)
Lower Right (  523.0,771030.0)
Center      (  261.5,385515.0)
Band 1 Block=128x128 Type=Byte, ColorInterp=Red
Band 2 Block=128x128 Type=Byte, ColorInterp=Green
Band 3 Block=128x128 Type=Byte, ColorInterp=Blue

I am starting with this:

gdal_create -of gtiff -outsize 523 12646632 -bands 3 -co BIGTIFF=YES -co TILED=YES -co JPEG_QUALITY=100 -co COMPRESS=JPEG -co INTERLEAVE=PIXEL -co JPEGTABLESMODE=1 -mo TIFFTAG_RESOLUTIONUNIT=2 -mo TIFFTAG_XRESOLUTION=25.4 -mo TIFFTAG_YRESOLUTION=25.4 concat_combined.tiff

and then attempting to concatenate existing TIFFs like this:

gdalwarp -to SRC_METHOD=NO_GEOTRANSFORM -to DST_METHOD=NO_GEOTRANSFORM ./1.tiff ./2.tiff ./3.tiff concat_combined.tiff
2
  • What do you mean by appending? Should the result be a multi-band tiff with as many bands as there are single-band source images? Or a multi-page TIFF?
    – user30184
    Commented Feb 27 at 11:57
  • It sounds like you want to mosaic the images. gdal.org/programs/gdal_merge.html
    – GBG
    Commented Feb 27 at 16:06

0

Browse other questions tagged or ask your own question.