From: Regina Obe Date: Tue, 21 Jun 2011 05:25:12 +0000 (+0000) Subject: Fix ST_GDalDrivers output to correctly output options as table. I had thought it... X-Git-Tag: 2.0.0alpha1~1386 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fefa4afa8497a1f0ef10f3213eab6f99d1a68e42;p=postgis Fix ST_GDalDrivers output to correctly output options as table. I had thought it was evenly balanced (all options have descriptions), but that is not the case so origianl example had the name and descriptions mismatched git-svn-id: http://svn.osgeo.org/postgis/trunk@7441 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index da4a47d4e..fb6cf7245 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -890,7 +890,7 @@ postgis_raster_lib_version Description Returns a list of raster formats short_name,long_name and creator options of each format supported by your lib gdal. Use the short_name as input in the format parameter of . - Options vary depending on what drivers your libgdal was compiled with. create_options returns an xml formatted list of opt_name/opt_description create_options for the specific driver. + Options vary depending on what drivers your libgdal was compiled with. create_options returns an xml formatted set of CreationOptionList/Option consisting of name and optional type,description for each creator option for the specific driver. Availability: 2.0.0 - requires GDAL >= 1.6.0. @@ -927,64 +927,53 @@ VRT | Virtual Raster XPM | X11 PixMap Format --- Output the create options XML column of Geo Tiff as a table -- +-- Output the create options XML column of JPEG as a table -- -- Note you can use these creator options in ST_AsGDALRaster options argument -SELECT unnest(xpath('/CreationOptionList/Option/@name', create_options::xml)) As opt_name, - unnest(xpath('/CreationOptionList/Option/@description', create_options::xml)) As opt_descrip -FROM st_gdaldrivers() -WHERE short_name = 'GTiff'; - - opt_name | opt_descrip ---------------------+---------------------------------------------------------------------- - COMPRESS | Predictor Type - PREDICTOR | JPEG quality 1-100 - JPEG_QUALITY | DEFLATE compression level 1-9 - ZLEVEL | BITS for sub-byte files (1-7), sub-uint16 (9-15), sub-uint 32 (17-31) - NBITS | Switch to tiled format - INTERLEAVE | Write out world file - TILED | Write out .RPB (RPC) file - TFW | Tile Width - RPB | Tile/Strip Height - BLOCKXSIZE | Can newly created files have missing blocks? - BLOCKYSIZE | Mark first extrasample as being alpha - PHOTOMETRIC | Force creation of BigTIFF file - SPARSE_OK | Force endianness of created file. For DEBUG purpose mostly - ALPHA | Force copy of overviews of source dataset (CreateCopy()) - PROFILE | Predictor Type - PIXELTYPE | JPEG quality 1-100 -: -: - +SELECT (xpath('@name', g.opt))[1]::text As oname, + (xpath('@type', g.opt))[1]::text As otype, + (xpath('@description', g.opt))[1]::text As descrip +FROM (SELECT unnest(xpath('/CreationOptionList/Option', create_options::xml)) As opt +FROM st_gdaldrivers() +WHERE short_name = 'JPEG') As g; + + oname | otype | descrip +-------------+---------+----------------------------- + PROGRESSIVE | boolean | + QUALITY | int | good=100, bad=0, default=75 + WORLDFILE | boolean | --- Output the create options XML column for JPEG as a table -- +-- Output the create options XML column for GTiff as a table -- -- Note you can use these creator options in ST_AsGDALRaster options argument -SELECT unnest(xpath('/CreationOptionList/Option/@name', create_options::xml)) As opt_name, - unnest(xpath('/CreationOptionList/Option/@description', create_options::xml)) As opt_descrip -FROM st_gdaldrivers() -WHERE short_name = 'GTiff'; - - opt_name | opt_descrip ---------------------+---------------------------------------------------------------------- - COMPRESS | Predictor Type - PREDICTOR | JPEG quality 1-100 - JPEG_QUALITY | DEFLATE compression level 1-9 - ZLEVEL | BITS for sub-byte files (1-7), sub-uint16 (9-15), sub-uint 32 (17-31) - NBITS | Switch to tiled format - INTERLEAVE | Write out world file - TILED | Write out .RPB (RPC) file - TFW | Tile Width - RPB | Tile/Strip Height - BLOCKXSIZE | Can newly created files have missing blocks? - BLOCKYSIZE | Mark first extrasample as being alpha - PHOTOMETRIC | Force creation of BigTIFF file - SPARSE_OK | Force endianness of created file. For DEBUG purpose mostly - ALPHA | Force copy of overviews of source dataset (CreateCopy()) - PROFILE | Predictor Type - PIXELTYPE | JPEG quality 1-100 -: -: - +SELECT (xpath('@name', g.opt))[1]::text As oname, + (xpath('@type', g.opt))[1]::text As otype, + (xpath('@description', g.opt))[1]::text As descrip +FROM (SELECT unnest(xpath('/CreationOptionList/Option', create_options::xml)) As opt +FROM st_gdaldrivers() +WHERE short_name = 'GTiff') As g; + + oname | otype | descrip +--------------------+---------------+---------------------------------------------------------------------- + COMPRESS | string-select | + PREDICTOR | int | Predictor Type + JPEG_QUALITY | int | JPEG quality 1-100 + ZLEVEL | int | DEFLATE compression level 1-9 + NBITS | int | BITS for sub-byte files (1-7), sub-uint16 (9-15), sub-uint32 (17-31) + INTERLEAVE | string-select | + TILED | boolean | Switch to tiled format + TFW | boolean | Write out world file + RPB | boolean | Write out .RPB (RPC) file + BLOCKXSIZE | int | Tile Width + BLOCKYSIZE | int | Tile/Strip Height + PHOTOMETRIC | string-select | + SPARSE_OK | boolean | Can newly created files have missing blocks? + ALPHA | boolean | Mark first extrasample as being alpha + PROFILE | string-select | + PIXELTYPE | string-select | + BIGTIFF | string-select | Force creation of BigTIFF file + ENDIANNESS | string-select | Force endianness of created file. For DEBUG purpose mostly + COPY_SRC_OVERVIEWS | boolean | Force copy of overviews of source dataset (CreateCopy()) +(19 rows)