Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given a time series of an area (single band), how you subset them and combine the subsets into a single multiband file (eg. vrt) using gdal or gdals' bindings for python?

share|improve this question
up vote 4 down vote accepted

I would first 'stack' them:

gdalbuildvrt -separate -input_file_list my_files.txt my.vrt

where the my_files contains a list of the files you want to use, in the specific order. Then crop with gdal_translate:

gdal_translate -projwin ulx uly lrx lry my.vrt my.tif
share|improve this answer

I would use gdal_translate and

Translate the images to crop (subset them) using gdal_translate. You could use a bash script to automate. Something along the lines below.

for f in *.tif;do gdal_translate -projwin ulx uly lrx lry "$f" "$f".cropped.tif ; done

Use to 'stack' the images. Here we are not explicitly controlling stack order. I believe these will stack alphanumerically in ascending order (0-9, then a-z). -separate -o myoutput.tif *.cropped.tif

I used -o myoutput.tif because I do not know if myoutput.vrt will work with I assume it would, as it is a GDAL supported format, but I have never tested it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.