Changes between Version 110 and Version 111 of WKTRaster/Documentation01


Ignore:
Timestamp:
Apr 22, 2011, 11:18:47 AM (13 years ago)
Author:
jorgearevalo
Comment:

Added information about how to load and dump data.

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/Documentation01

    v110 v111  
    397397One of the major PostGIS Raster features is the ability to store raster data in the database or merely register them as external files residing in the filesystem. When registering a raster, only the raster metadata are stored in the database (width, height, number of band, georeference and path to the actual raster file), not the values associated with the pixels. Registering is done via the loader’s –R option.
    398398{{{
    399 >gdal2wktraster.py –r c:/imagesets/landsat/image01.tif –t landsat -R
     399>raster2pgsql.py –r c:/imagesets/landsat/image01.tif –t landsat -R
    400400}}}
    401401
     
    423423== '''3.3 - Loader/Dumper''' ==
    424424
     425So 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
     432Execute
     433
     434{{{
     435> python raster2pgsql.py --help
     436}}}
     437
     438To 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
     440Some basic examples:
     441
     442Generate 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{{{
     445python raster2pgsql.py -r myfile.tif -t mytable -o mytable.sql
     446}}}
     447
     448Generate 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{{{
     451python raster2pgsql.py -r myfile.tif -t mytable -s 4326 -o mytable.sql
     452}}}
     453
     454Generate 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{{{
     457python raster2pgsql.py -r myfile.tif -t mytable -s 4326 -I -k 40x20 -o mytable.sql
     458}}}
     459
     460
     461'''3.3.2 - Dumper'''
     462
     463Check 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
    425466
    426467== '''3.4 - Building Indexes''' ==