Attention
Following the recent operating system upgrade, software listings and module load commands now reflect the upgraded system. Some examples and notices are still being updated and may contain outdated guidance.
- guidance_last_updated:
2024-12-16
Geospatial Data Abstraction Library (GDAL)
GDAL is a library used by many Geographic Information Systems (GIS) packages for converting between many different raster and vector GIS data formats. It also includes command-line utilities for data translation and processing. It is released under an X/MIT style Open Source license by the Open Source Geospatial Foundation.
Usage
After connecting to Stanage (see Establishing a SSH connection), start an interactive session with the following command:
srun --pty bash -i
Load by running one of the following:
module load GDAL/3.11.3-intel-2025b
module load GDAL/3.6.2-foss-2022b
This will:
add several GDAL programs to your
PATHenvironment variableallow other programs to make use of (dynamically link against) the GDAL library
load the matching compiler/toolchain and library dependencies
The examples below use GDAL/3.11.3-intel-2025b. Loading this module also
loads the matching Intel toolchain and Python dependencies. Check the version:
module load GDAL/3.11.3-intel-2025b
gdal-config --version
The expected version is 3.11.3. Some commonly used programs are:
gdalinfo: inspect raster metadatagdal_translate: convert raster formats or extract a subsetgdalwarp: reproject or resample rastersgdalbuildvrt: build a virtual raster from input datasetsgdaladdo: create raster overviewsogrinfo: inspect vector datasetsogr2ogr: convert or reproject vector datasets
List the raster and vector formats supported by the installed build with:
gdalinfo --formats
ogrinfo --formats
Raster examples
For a georeferenced raster named input.tif, inspect its metadata and create
an LZW-compressed GeoTIFF copy:
gdalinfo input.tif
gdal_translate -of GTiff -co COMPRESS=LZW input.tif compressed.tif
To reproject it to Web Mercator (EPSG:3857), using nearest-neighbour resampling:
gdalwarp -t_srs EPSG:3857 -r near input.tif projected.tif
Choose a target coordinate system and resampling method appropriate for your data.
Vector examples
For a GeoJSON dataset named points.geojson, inspect its layers and convert
it to a GeoPackage:
ogrinfo -al -so points.geojson
ogr2ogr -f GPKG points.gpkg points.geojson
Batch submission
The following example batch submission script inspects and compresses
input.tif. Submit it from the directory containing that input file.
#!/bin/bash
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=2G
#SBATCH --time=00:05:00
set -e
export SLURM_EXPORT_ENV=ALL
module load GDAL/3.11.3-intel-2025b
srun gdalinfo input.tif
srun gdal_translate -of GTiff -co COMPRESS=LZW input.tif compressed.tif
Save as gdal.slurm and submit with:
sbatch gdal.slurm
Documentation
Documentation is available on the project site.
Installation notes
GDAL was installed using Easybuild, build details can be found in $EBROOTGDAL/easybuild with a given module loaded.