We have seen ogr2ogr
in action already, and now it is time to give two GDAL tools a spin: gdal_translate
and gdalwarp
. The former is a translation utility that can change the format of a raster datasource while the latter is a reprojection utility. Therefore, in order to extract a reprojected raster from a PostGIS database, we need to perform two steps:
- Extract the raster using
gdal_translate
- Perform a reprojection using
gdalwarp
In order to get some help with both utilities, simply type the following in the console:
gdal_translate
You could also use the following:
gdalwarp
The most important parameters of gdal_translate
for our scenario are:
-of
: Specifies the output format (usegdal_translate
-formats to obtain information on the supported formats).-outsize xsize[%] ysize[%]
: Specifies the output raster size. It can be expressed in pixels or a percentage. If it is not used 100%, then the original size is assumedPG
(PgSQL connection opts): PgSQL connection options...