Database Reference
In-Depth Information
Band 2 Block=128x128 Type=Int16,
ColorInterp=Undefined
Min=-421.000 Max=414.000
NoData Value=-9999
...
9. Importthevirtualrastercomposedof12bands,eachreferringtooneofthe
12originalrasters,toaPostGISrastertablecomposedof12bands.Forthis
purpose, you can use the raster2pgsql command:
$ raster2pgsql -d -I -C -M -F -t 100x100
-s 4326 tmax_2012.vrt
chp01.tmax_2012_multi >
tmax_2012_multi.sql
$ psql -d postgis_cookbook -U me -f
tmax_2012_multi.sql
10. Query the raster_columns view to get some indicators for the imported
raster. Note as the num_bands is now 12:
postgis_cookbook=# SELECT
r_raster_column, srid, blocksize_x,
blocksize_y, num_bands, pixel_types from
raster_columns where
r_table_schema='chp01' AND r_table_name
='tmax_2012_multi';
r_raster_column | srid | blocksize_x |
blocksize_y | num_bands
|
pixel_types
-----------------+------+-------------+-------------+-----------+---------------------------------------------------------------------------
rast | 4326 | 100
| 100 | 12 |
{16BSI,16BSI,16BSI,16BSI,16BSI,16BSI,16BSI,16BSI,16BSI,16BSI,16BSI,16BSI}
11. Now,let'strytoproducethesameoutputofthequerywiththepreviousap-
proach. This time, given the table structure, we keep the results in a single
row:
Search WWH ::




Custom Search