| 425 | So far, there's no native loader/dumper. Instead: |
| 426 | * Use python loader '''raster2pgsql.py''' (in <postgis_sources_root>/raster/scripts/python) to load raster data into the database. |
| 427 | * Use [http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html GDAL PostGIS Raster driver] to dump raster data to disk again. |
| 428 | |
| 429 | |
| 430 | '''3.3.1 - Loader''' |
| 431 | |
| 432 | Execute |
| 433 | |
| 434 | {{{ |
| 435 | > python raster2pgsql.py --help |
| 436 | }}} |
| 437 | |
| 438 | To get full information about the loader syntax. It creates a SQL file, ready to be loaded in your database. The database must have been enabled with PostGIS and PostGIS Raster. Check section 2.3.4 to know how to create and enable a new PostgreSQL database. |
| 439 | |
| 440 | Some basic examples: |
| 441 | |
| 442 | Generate the SQL output (as mytable.sql file) to load a TIF file into database. The file is loaded in 1 row's table. The table is previously created. |
| 443 | |
| 444 | {{{ |
| 445 | python raster2pgsql.py -r myfile.tif -t mytable -o mytable.sql |
| 446 | }}} |
| 447 | |
| 448 | Generate the SQL output (as mytable.sql file) to load a TIF file into database and georeference it using SRID 4326. The file is loaded in 1 row's table. The table is previously created. |
| 449 | |
| 450 | {{{ |
| 451 | python raster2pgsql.py -r myfile.tif -t mytable -s 4326 -o mytable.sql |
| 452 | }}} |
| 453 | |
| 454 | Generate the SQL output (as mytable.sql file) to load a TIF file into database, georeference it using SRID 4326, split the file in tiles of 40x20 px (one per row) and create a GiST index over the raster column. The number of rows is dependent on the raster size, in pixels. The table is previously created. |
| 455 | |
| 456 | {{{ |
| 457 | python raster2pgsql.py -r myfile.tif -t mytable -s 4326 -I -k 40x20 -o mytable.sql |
| 458 | }}} |
| 459 | |
| 460 | |
| 461 | '''3.3.2 - Dumper''' |
| 462 | |
| 463 | Check the [http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html GDAL PostGIS Raster page] to know how to dump PostGIS Raster tables to disk files using [http://www.gdal.org/gdal_translate.html gdal_translate]. |
| 464 | |
| 465 | |