gdalwarp
Reproject and transform raster images
TLDR
Reproject a raster dataset
Crop a raster dataset by using specific coordinates
Crop a raster dataset using a vector layer
SYNOPSIS
gdalwarp [--help] [--help-general] [--formats] [--format
PARAMETERS
-co "NAME=VALUE"
Raster creation option; may be used more than once
-s_srs
Source spatial reference set (input SRS)
-t_srs
Target spatial reference set (output SRS)
-te
Extent to reproject/resample to (user extent)
-tr
Target resolution in target georeferenced units
-tap
Target resolution in pixels aligned with the input dataset
-r
Resampling method (near, bilinear, cubic, cubicspline, lanczos, average, mode, max, min, med, q1, q3, sum, rms)
-dstnodata
Value to write for output image nodata pixels
-srcnodata
Nodata values for input image(s) (space or comma separated list)
-of
Output file format name
-ot
Output pixel type (Byte, Int16, UInt16, UInt32, Int32, Float32, Float64, CInt16, CInt32, CFloat32, CFloat64)
-multi
Use multi-threaded warping implementation
-wm
Working memory limit in MB
-et
Number of threads for TPS warping (if -tps used)
-tps
Use Thin Plate Spline warping method
-clipsrc
Clip to polygon in shapefile
-cutline
Cutline polygon shapefile for masking
-crop_to_cutline
Crop to cutline extent
-overwrite
Overwrite output file if it exists
-q
Quiet mode, suppress progress display
-projwin
Source window in projected coordinates
-ts
Target size in pixels
-a_srs
Assign projection if no input SRS
-dstalpha
Create alpha band in output
-wo "NAME=VALUE"
Warp options (e.g., NUM_THREADS)
DESCRIPTION
GDALWarp, part of the GDAL (Geospatial Data Abstraction Library), reprojects and warps raster datasets from one spatial reference system to another. It handles resampling during reprojection, supports cutline-based warping, and works with various raster formats. Ideal for aligning rasters to a common projection, changing resolutions, or mosaicking images.
The tool performs geometric transformations using algorithms like nearest neighbor, bilinear, or cubic convolution. It can clip to polygons, set nodata values, and control output resolution/extent. Multi-threaded processing and virtual rasters (VRT) optimize large dataset handling.
Common uses include preparing data for GIS analysis, orthorectification, or mosaic creation. Output formats include GeoTIFF, NetCDF, and more. Memory management options prevent crashes on huge files.
CAVEATS
Memory-intensive for large rasters; use -wm and -multi for optimization. Resampling may introduce artifacts. No support for vector reprojection (use ogr2ogr). TPS method slow for large datasets.
COMMON RESAMPLING METHODS
-r near: Fastest, preserves categories.
-r bilinear/cubic: Smooth interpolation.
-r average: For continuous data.
-r mode: For categorical.
EXAMPLE USAGE
gdalwarp -t_srs EPSG:4326 -tr 0.01 0.01 input.tif output.tif
Warp to WGS84 at 0.01 degree res.
gdalwarp -cutline mask.shp -crop_to_cutline input.tif output.tif
Clip to shapefile polygon.
HISTORY
GDAL developed by Frank Warmerdam starting 1998; gdalwarp introduced in early versions (~2001) as core reprojection tool. Evolved with resampling algos, multi-threading (GDAL 1.10+), and VSI support. Now at GDAL 3.x, integral to OSGeo ecosystem.
SEE ALSO
gdal_translate(1), gdalinfo(1), gdal_merge.py(1), gdal_polygonize(1), ogr2ogr(1)


