Forrest logo
back to the gdal_translate tool

gdal_translate:tldr:22155

gdal_translate: Assign a projection to a raster dataset.
$ gdal_translate -a_srs ${EPSG:4326} ${path-to-input-tif} ${path-to-output-tif}
try on your machine

The command gdal_translate is used to convert raster data from one format to another. It is a tool that is part of the Geospatial Data Abstraction Library (GDAL).

Let's break down the command:

  • gdal_translate: This is the main command which invokes the gdal_translate tool.

  • -a_srs: This is an option flag used to specify the target spatial reference system (SRS) of the output raster. In this case, ${EPSG:4326} represents the EPSG code 4326, which corresponds to the commonly used coordinate reference system WGS84, also known as the geographic coordinate system for latitude and longitude.

  • ${path-to-input-tif}: This is the path to the input raster file that you want to translate or convert.

  • ${path-to-output-tif}: This is the path where you want to save the translated raster file.

So, overall, this command will take an input raster file (${path-to-input-tif}), apply the specified target spatial reference system (${EPSG:4326}), and save the translated raster file to the specified output path (${path-to-output-tif}).

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 gdal_translate tool