= '''PostGIS WKT Raster Beta 0.1 Final Specifications''' = {{{ #!html
}}} '''Quick Links''' * [wiki:WKTRaster WKT Raster Home Page] * [wiki:WKTRaster/PlanningAndFunding Planning & Funding] * [wiki:WKTRaster/SpecificationWorking01 Working Specifications for Beta 0.1.6] * [wiki:WKTRaster/SpecificationWorking02 Working Specifications for Beta 0.2.4] * [wiki:WKTRaster/SpecificationFinal02 Final Specifications for Beta 0.2.4] {{{ #!html
}}} ---- == '''Objective 0.1.6c - Being able to load rasters in the database ''' == '''gdal2wktraster.py -''' A prototype of the translation utility implemented in Python and with use of [http://www.gdal.org/ GDAL] and its bindings to Python. Create an SQL commands output to create a table of raster. As input raster file, all GDAL formats are accepted. The script is available as [http://svn.refractions.net/postgis/spike/wktraster/scripts/gdal2wktraster.py gdal2wktraster.py] script. '''Open Questions:'''[[BR]] [[BR]] 1. Should we change names of options to strictly follow those used by raster2pgsql and shp2pgsql?[[BR]][[BR]] Pierre: Yes! We should follow PostGIS tracks as much as possible in everything we do in this project.[[BR]][[BR]] 1. How can I import all the bands from a multiband TIFF? '''USAGE:'''[[BR]] '''gdal2wktraster.py''' -r rasterfile [-r rasterfile] -t [.] [] '''-r''' Specifies input raster file. Multiple -r options can be specified for a number of input files or wildcards can be used (? and *). At least one input raster file is REQUIRED.[[BR]] '''-t'''
Name of destination table in with or without target schema specified. This parameter is REQUIRED. '''OPTIONS:'''[[BR]] '''-s''' Set the SRID field. Default is -1.[[BR]] '''-b''' Specify the number of band. The number of rasterfile must correspond to this number.[[BR]] '''-f''' Name of target column for raster data. Default column name is rast.[[BR]] '''-I''' Create a GiST index on the raster column.[[BR]] '''-o''' Output file for generated SQL commands. If not specified, stdout is assumed.[[BR]] '''-R''' Simply register the raster in the database. Absolute path to the raster and georeferencing informations are stored instead of the raster actual data.[[BR]] '''-F''' Add a "filename" column containing the original name of the loaded raster file. '''(-d|c)''' Mutually exclusive inserting options:[[BR]] '''-d''' Drops the table, then recreates it and populates it with current raster file data.[[BR]] '''-c''' Creates a new table and populates it, this is the default if you do not specify any options. '''-v''' Switch on excessively verbose mode, useful for debugging.[[BR]] '''-h''' Display this help screen. ----