Database Reference
In-Depth Information
Exporting
rasters
with
the
gdal_translate
and
gdalwarp
GDAL
commands
In this recipe, you will see a couple of main options for exporting PostGIS rasters
to different raster formats. They are both provided as command-line tools,
gdal_translate and gdalwarp , by GDAL.
Getting ready
Youneedthefollowinginplacebeforeyoucanproceedwiththestepsrequiredforthe
recipe:
1. You need to have gone through the previous recipe and imported the tmax
2012 datasets (12 .bil files) as a single multiband (12 bands) raster in
PostGIS.
2. YoumusthavethePostGISrasterformatenabledinGDAL.Forthispurpose,
check the output of the following command:
$ gdalinfo --formats | grep -i postgis
The output of the preceding command is as follows:
PostGISRaster (rw): PostGIS Raster driver
3. YoushouldhavealreadylearnedhowtousetheGDALPostGISrasterdriver
intheprevioustworecipes.Youneedtouseaconnectionstringcomposedof
the following parameters:
$ gdalinfo PG:"host=localhost port=5432
dbname='postgis_cookbook' user='me'
password='mypassword'
schema='chp01'password='mypassword'
schema='chp01' table='tmax_2012_multi'
mode='2'"
Search WWH ::




Custom Search