From: Regina Obe Date: Tue, 21 Jun 2011 03:26:48 +0000 (+0000) Subject: document ST_AsJPEG and fill in missing protos for ST_ValueCount X-Git-Tag: 2.0.0alpha1~1389 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e0a2cc9d327869a66092be3f595f5082d3dd1c2;p=postgis document ST_AsJPEG and fill in missing protos for ST_ValueCount git-svn-id: http://svn.osgeo.org/postgis/trunk@7438 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index 63b646274..3bcc025f0 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -955,6 +955,36 @@ WHERE short_name = 'GTiff'; : : + + +-- Output the create options XML column for 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 +: +: + @@ -3842,7 +3872,7 @@ FROM (SELECT band, ST_SummaryStats('o_4_boston','rast', band,true,0.25) As stats double precision[] searchvalues=NULL double precision roundto=0 double precision OUT value - double precision OUT count + bigint OUT count SETOF record ST_ValueCount @@ -3851,7 +3881,7 @@ FROM (SELECT band, ST_SummaryStats('o_4_boston','rast', band,true,0.25) As stats double precision[] searchvalues double precision roundto=0 double precision OUT value - double precision OUT count + bigint OUT count SETOF record ST_ValueCount @@ -3859,18 +3889,27 @@ FROM (SELECT band, ST_SummaryStats('o_4_boston','rast', band,true,0.25) As stats double precision[] searchvalues double precision roundto=0 double precision OUT value - double precision OUT count + bigint OUT count - integer ST_ValueCount + bigint ST_ValueCount raster rast double precision searchvalue double precision roundto=0 - integer ST_ValueCount + bigint ST_ValueCount + raster rast + integer nband + boolean exclude_nodata_value + double precision searchvalue + double precision roundto=0 + + + + bigint ST_ValueCount raster rast integer nband double precision searchvalue @@ -3886,16 +3925,35 @@ FROM (SELECT band, ST_SummaryStats('o_4_boston','rast', band,true,0.25) As stats double precision[] searchvalues=NULL double precision roundto=0 double precision OUT value - double precision OUT count + bigint OUT count + + + SETOF record ST_ValueCount + text rastertable + text rastercolumn + double precision[] searchvalues + double precision roundto=0 + double precision OUT value + bigint OUT count SETOF record ST_ValueCount text rastertable text rastercolumn + integer nband double precision[] searchvalues double precision roundto=0 double precision OUT value - double precision OUT count + bigint OUT count + + + bigintST_ValueCount + text rastertable + text rastercolumn + integer nband + boolean exclude_nodata_value + double precision searchvalue + double precision roundto=0 bigint ST_ValueCount @@ -4132,6 +4190,94 @@ FROM dummy_rast WHERE rid=2; + + + ST_AsJPEG + Return the raster tile selected bands as a single Joint Photographic Exports Group (JPEG) image (byte array). If no band is specified, then the first 3 bands are used. + + + + + + bytea ST_AsJPEG + raster rast + text[] options=NULL + + + bytea ST_AsJPEG + raster rast + integer nband + integer quality + + + bytea ST_AsJPEG + raster rast + integer nband + text[] options=NULL + + + bytea ST_AsJPEG + raster rast + integer[] nbands + text[] options=NULL + + + bytea ST_AsJPEG + raster rast + integer[] nbands + integer quality + + + bytea ST_AsPNG + raster rast + integer[] nbands + text[] options=NULL + + + + + + Description + + Returns the selected bands of the raster as a single Joint Photographic Exports Group Image (JPEG). Use if you need to export as less common raster types. If no band is specified, then the first 3 bands are exported. There are many variants of the function with many options. These are itemized below: + + + nband is for single band exports. + + + nbands is an array of bands to export (note that max is 3 for JPEG) and the order of the bands is RGB. e.g ARRAY[3,2,1] means map band 3 to Red, band 2 to green and band 1 to blue + + quality number from 0 to 100. The higher the number the crisper the image. + options text Array of GDAL options as defined for JPEG (look at create_options for JPEG ). For JPEG valid ones are PROGRESSIVE ON or OFF and QUALITY a range from 0 to 100 and default to 75. Refer to GDAL Raster format options for more details. + + + Availability: 2.0.0 - requires GDAL >= 1.6.0. + + + + Examples: Output + + -- output first 3 bands 75% quality +SELECT ST_AsJPEG(rast) As rastjpg + FROM dummy_rast WHERE rid=2; + +-- output only first band as 90% quality +SELECT ST_AsJPEG(rast,1,90) As rastjpg + FROM dummy_rast WHERE rid=2; + +-- output first 3 bands (but make band 2 Red, band 1 green, and band 3 blue, progressive and 90% quality +SELECT ST_AsJPEG(rast,ARRAY[2,1,3],ARRAY['QUALITY=90','PROGRESSIVE=ON']) As rastjpg + FROM dummy_rast WHERE rid=2; + + + + + + See Also + , ,, + + + ST_AsPNG