GDAL Command-line Cookbook
Introduction
Welcome to the GDAL Users Cookbook. This guide provides practical examples for working with raster and vector data using the GDAL command-line tools. It demonstrates common tasks such as raster analysis, vector geometry operations, and combining raster and vector workflows.
The cookbook uses a question and answer format, linking to relevant examples elsewhere in the GDAL documentation.
General How do I...
- ... get the GDAL version?
Raster How do I...
- ... resize a raster?
Resize a dataset to 1000 columns and 500 lines using cubic resampling.
- ... create a Cloud Optimized GeoTIFF (COG)?
- ... check if a GeoTIFF is a Cloud Optimized GeoTIFF (COG)?
Vector How do I...
- ... check if
Xvector driver is installed? - ... buffer geometries?
Compute a buffer of one km around input geometries (assuming the CRS is in meters)
- ... buffer geometries using an attribute?
- ... list all layers in a dataset?
Raster and Vector How do I...
- ... burn a vector dataset into a raster?
- ... extract pixel values from a raster and apply them to a point dataset?
- ... know which CRSs are suitable for reprojecting my dataset?