Changes between Version 68 and Version 69 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
04/23/11 08:38:43 (14 years ago)
Author:
dustymugs
Comment:

ST_AsJPEG

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v68 v69  
    219219 ST_AsJPEG(raster, integer, "GRAYSCALE", integer, min, max, text) - allow specifying the band number to convert and the quality
    220220
     221Bborie: The JPEG format has several limitations:
     222
     223  1. JPEG only allows 1 (greyscale) or 3 (RGB) bands of data
     224
     225  2. JPEG only supports 8BUI pixeltype
     226
     227  3. JPEG cannot embed spatial reference information within the file but can have an associated world file
     228
     229To address the limitations:
     230
     231  1. Use ST_Band to specify which band(s) should be passed to the ST_AsJPEG function. Variations of ST_AsJPEG are made available that allows specifying a band index. If a raster whose number of specified bands does not equal 1 or 3 is provided, a warning is raised and the first or the first three bands are used.
     232
     233  2. Throw an exception if any of the specified bands is not 8BUI. The user should use ST_Reclass to convert any non-8BUI bands to 8BUI.
     234
     235  3. Nothing can be done.
     236
     237A proposed set of variations of the ST_AsJPEG function:
     238
     2391. ST_AsJPEG(rast raster, options text[])
     240
     241    rast: the raster with one or three bands in 8BUI pixel type to generate a JPEG image from
     242
     243    options: array of creation options to pass to the GDAL JPEG driver
     244
     245{{{
     246ST_AsJPEG(rast, ARRAY['QUALITY=90', 'PROGRESSIVE=ON'])
     247}}}
     248
     2492. ST_AsJPEG(rast raster)
     250
     251    Like !#1 above but use the driver's default creation options
     252
     2533. ST_AsJPEG(rast raster, nbands int[], options text[])
     254
     255    nbands: an integer array specifying the band indices of the raster to include in the JPEG file
     256
     257{{{
     258ST_AsJPEG(rast, ARRAY[1,3,6], ARRAY['QUALITY=50'])
     259}}}
     260
     2614. ST_AsJPEG(rast raster, nbands int[])
     262
     263    Like !#3, but use the default creation options
     264
     265{{{
     266ST_AsJPEG(rast, ARRAY[1,3,6])
     267}}}
     268
     2695. ST_AsJPEG(rast raster, nbands int[], quality int)
     270
     271    quality: number between 10 and 100 indicating image quality
     272
     273{{{
     274ST_AsJPEG(rast, ARRAY[1,2,3], 90)
     275}}}
     276
     2776. ST_AsJPEG(rast raster, nband int, options text[])
     278
     279    nband: index of the band to include
     280
     281{{{
     282ST_AsJPEG(rast, 2, ARRAY['QUALITY=25'])
     283}}}
     284
     2857. ST_AsJPEG(rast raster, nband int, quality int)
     286
     287{{{
     288ST_AsJPEG(rast, 5, 75)
     289}}}
     290
     2918. ST_AsJPEG(rast raster, nband int)
     292
     293{{{
     294ST_AsJPEG(rast, 4)
     295}}}
    221296
    222297----
     
    380455    rast: the raster with one or three bands in 8BUI or 16BUI pixel type to generate a PNG image from
    381456
    382     options: array of creation options to pass to the GDAL JPEG driver
     457    options: array of creation options to pass to the GDAL PNG driver
    383458
    384459{{{