Skip to main content
100%

gdalwarp as a gdal_merge.py alternative in a GNU Makefile

✓ Published0🌍 Public
Aalpha-beta-soup
Last edited Apr 4, 2019
Created on Apr 4, 2019

This example demonstrates how GNU Make and GDAL’s `gdalwarp` command-line tool can replace `gdal_merge.py` for mosaicking multiple GeoTIFF files without loading all data into memory. It shows a Makefile recipe that first runs `gdalwarp` with `-overwrite` on the initial input to create the output, then appends each remaining file via a `$(foreach)` loop. The code uses GDAL’s GTiff creation options (e.g., `TILED=YES`, `COMPRESS=LZW`) and multi-threading flags (`-multi`, `-wo NUM_THREADS=ALL_CPUS`), while the makefile relies on `.ONESHELL` to chain commands. The data source is a set of five local GeoTIFF files (`a.tif` through `e.tif`).

AI-generated description

Similar vizzes