Changes between Version 48 and Version 49 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
04/06/11 07:04:08 (14 years ago)
Author:
dustymugs
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v48 v49  
    4141'''ST_Band(raster, integer) -> raster''' -- the integer parameters are the band number of the rasters.[[BR]]
    4242Return a single band from a multiband raster. If "band" is greater than the value returned by ST_GetNumBands(), the function returns the last band. This function should be used to select a band before converting it to JPEG, TIFF, PNG, SVG or KML with the corresponding function. e.g. '''ST_AsTIFF(ST_Band(raster, band))
     43
     44'''Bborie: A complete implementation of ST_Band would include the following:
     45
     46ST_Band(rast raster, nbands int[]) -> raster
     47
     48    nbands is an array of 1-based band indices of the bands to copy into the output raster
     49
     50    Ex: For a raster rast with 3 bands:
     51
     52        ST_Band(rast, ARRAY[1,3,2])
     53
     54        ST_Band(rast, ARRAY[3,2,1])
     55
     56        You can rearrange the bands as above. You can also duplicate the bands:
     57
     58        ST_Band(rast, ARRAY[1,2,3,2,1])
     59
     60ST_Band(rast raster, nband int) -> raster
     61
     62    nband is a single integer of the 1-based band index of the band to copy into the output raster
     63
     64    Ex: ST_Band(rast, 1)
     65
     66        ST_Band(rast, 3)
     67
     68ST_Band(rast raster, nbands text) -> raster
     69
     70    nbands is a comma separated string of 1-based band indices indicating the bands to copy into the output raster
     71
     72    Ex: ST_Band(rast, '1,2')
     73
     74        ST_Band(rast, '1,2,3, 1, 1 , 2')
     75
     76ST_Band(rast raster) -> raster
     77
     78    the band to extract is automatically assumed to be one.
     79
     80    Ex: ST_Band(rast)
     81
     82If an index is outside the valid range of band indices for a raster (less than 1 or greater than the value returned by ST_NumBands), the function will fail and return.
     83
     84''' Open Question: ''' Should the function fail if an index is invalid?  How should this work when providing more than one indices to the function?
    4385
    4486----