Forrest logo
back to the gdalwarp tool

gdalwarp:tldr:59ae5

gdalwarp: Reproject a raster dataset.
$ gdalwarp -t_srs ${EPSG:4326} ${path-to-input-tif} ${path-to-output-tif}
try on your machine

The command gdalwarp is a utility program provided by GDAL (Geospatial Data Abstraction Library) to reproject raster data.

Here's the breakdown of the command:

  • gdalwarp: Calls the gdalwarp utility.
  • -t_srs: Specifies the target spatial reference system (SRS) to which the input raster will be reprojected. In this case, it uses the ${EPSG:4326} expression, which represents the EPSG code for the WGS 84 coordinate system (commonly used for representing latitude and longitude).
  • ${path-to-input-tif}: Represents the path to the input TIFF image (raster) file that you want to reproject.
  • ${path-to-output-tif}: Specifies the path to which the output TIFF file (reprojected raster) will be saved.

For example, if you have a TIFF image located at /path/to/input.tif, and you want to reproject it to WGS 84 coordinate system and save the output as /path/to/output.tif, your command would look like this:

gdalwarp -t_srs EPSG:4326 /path/to/input.tif /path/to/output.tif

Make sure to adjust the paths according to your specific file locations.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gdalwarp tool