Tutorial: Introduction to GDAL

4. Reprojecting GIS data

4.1. Reproject raster data

GDAL has the capability to reproject a raster file using the following syntax:

gdal raster reproject -d EPSG:... <input> <output>

The -d argument specifies the target coordinate system. If the source coordinate system is unknown it must be specified with the -s argument. EPSG:... specifies the EPSG code of the projection. <input> and <output> are the input and output data respectively.

We are now going to reproject a Digital Elevation Model (DEM) acquired by the Shuttle Radar Topography Mission (SRTM). You can  download DEM's for your own area of interest from USGS Earth Explorer. Here we'll use the provided course data.

In order to reproject the DEM from WGS-84 lat/lon to Amersfoort/RD New we use this command:

gdal raster reproject -d EPSG:XXXXX srtm_37_02.tif dem_rd.tif

1. Replace XXXXX with the proper EPSG code for Amersfoort/RD New (see one of your previous answers using gdal info).

2. Execute the command:

gdal raster reproject -d EPSG:28992 srtm_37_02.tif dem_rd.tif <ENTER>

3. Visualize the result in QGIS.

More info on the gdal raster reproject command can be found here.

Note that by default nearest neighbour resampling is used. Check the command arguments in the documentation if you want to use another resampling method and control the output cell size.