Skip to main content

GDAL

Introduction to GDAL​

GDAL (Geospatial Data Abstraction Library) is an open-source library for reading, writing, and processing geospatial data. It supports a wide range of raster and vector data formats, making it a powerful tool for geospatial data analysis and manipulation. GDAL is widely used in Geographic Information Systems (GIS), remote sensing, and scientific research.

GDAL provides command-line utilities for data conversion, transformation, and analysis, as well as a programming API for integration into custom applications. It is highly versatile and supports advanced operations such as reprojection, resampling, and raster algebra. For more details, visit the official GDAL documentation.

Using GDAL with Modules​

To use GDAL on the terrabyte HPC system, load the GDAL module with the following command:

module load gdal

Once loaded, you can execute GDAL commands to process geospatial data. Below are some examples of common GDAL operations:

Usage Examples​

Example 1: Convert a Raster File to a Different Format​

To convert a raster file from GeoTIFF to PNG format:

gdal_translate input.tif output.png

Example 2: Reproject a Raster File​

To reproject a raster file to a different coordinate reference system (CRS):

gdalwarp -t_srs EPSG:4326 input.tif output_reprojected.tif

Example 3: Clip a Raster File​

To clip a raster file to a specific bounding box:

gdal_translate -projwin xmin ymax xmax ymin input.tif output_clipped.tif

Example 4: Convert Vector Data with ogr2ogr​

The ogr2ogr utility is part of GDAL and is used for vector data processing. For example, to convert a Shapefile to GeoJSON:

ogr2ogr -f GeoJSON output.json input.shp

Example 5: Reproject Vector Data with ogr2ogr​

To reproject a Shapefile to a different CRS:

ogr2ogr -t_srs EPSG:4326 output_reprojected.shp input.shp

Example 6: Extract Specific Features with ogr2ogr​

To extract features from a Shapefile based on an attribute filter:

ogr2ogr -where "attribute='value'" output_filtered.shp input.shp

For additional usage instructions and configuration details, refer to the GDAL documentation.