MARKDOWN 204
QGIS - Batch Pyramids and Virtual Raster OSGeo4W By mike on 19th November 2021 09:16:11 PM

Batch create Pyramids and Virtual Raster from OSGeo4W commandline

Convert all PNG in current dir to GeoTIFF
for %i in (*.png) do gdal_translate --config GDAL_CACHEMAX 1024 -co NUM_THREADS=ALL_CPUS -co COMPRESS=DEFLATE -co ZLEVEL=9 -co PREDICTOR=2 -co TILED=YES %i %~ni.tif

Create external pyramides for all TIF in current dir
for %i in (*.tif) do gdaladdo -ro -r cubic %i 2 4 8 16

Create VRT file for all TIF in current dir
gdalbuildvrt mosaic.vrt *.tif

Create external pyramide for VRT (huge and slow, not recommended on large file set)
gdaladdo -ro -r cubic mosaic.vrt 2 4 8 16

Note; Above are single line terminal commands, not directly usable in a batch file
https://docs.qgis.org/3.22/en/docs/user_manual/processing_algs/gdal/rastermiscellaneous.html
https://gdal.org/programs/gdal_merge.html

Hasta la pasta! is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.