Changes between Version 84 and Version 85 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
May 24, 2011, 11:17:31 AM (13 years ago)
Author:
Bborie Park
Comment:

strikeout old questions that have been answered with implemented functions

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v84 v85  
    2121
    2222----
    23 '''Open Question:''' When exporting a multiband raster to JPEG, TIFF, PNG, SVG or KML, how should we specify the band number in the exporting function.
    24 
    25 There is two options to select the band to convert from a multiband raster in all the ST_AsFormat functions. [[BR]]
     23~~'''Open Question:''' When exporting a multiband raster to JPEG, TIFF, PNG, SVG or KML, how should we specify the band number in the exporting function.~~
     24
     25~~There is two options to select the band to convert from a multiband raster in all the ST_AsFormat functions. [[BR]]~~
    2626[[BR]]
    27  1. Precede each call with ST_Band() to return a selected band.[[BR]]
    28   Pros: This is a general function that can be called before any function that would otherwise require a band parameter.[[BR]]
    29   Cons: This implies creating a temporary raster. This might be more elegant and general but is this too much overhead comparing with having a band parameter?
    30 
    31  2. Add a band parameter to each ST_AsFormat function.[[BR]]
    32   Pros: Hypothetically less overhead.[[BR]]
    33   Cons: Every functions implying access to a band should then have this parameter when in most case it would be equal to 1. In many cases it makes no sence to have to specify a band parameter since it is the whole raster that we want to export, including all the bands.
    34 
    35 Pierre: More I think about it more I think that the first option is the best one...
    36 
    37 mloskot: Perhaps there is a compromise in form of two sets of functions: 1) ST_As* which always burn the whole raster (all bands) 2) ST_BandAs* which takes number of band as a parameter and return only this requested band.
     27~~ 1. Precede each call with ST_Band() to return a selected band.[[BR]]~~
     28~~  Pros: This is a general function that can be called before any function that would otherwise require a band parameter.[[BR]]~~
     29~~  Cons: This implies creating a temporary raster. This might be more elegant and general but is this too much overhead comparing with having a band parameter?~~
     30
     31~~ 2. Add a band parameter to each ST_AsFormat function.[[BR]]~~
     32~~  Pros: Hypothetically less overhead.[[BR]]~~
     33~~  Cons: Every functions implying access to a band should then have this parameter when in most case it would be equal to 1. In many cases it makes no sence to have to specify a band parameter since it is the whole raster that we want to export, including all the bands.~~
     34
     35~~Pierre: More I think about it more I think that the first option is the best one...~~
     36
     37~~mloskot: Perhaps there is a compromise in form of two sets of functions: 1) ST_As* which always burn the whole raster (all bands) 2) ST_BandAs* which takes number of band as a parameter and return only this requested band.~~
    3838
    3939----
     
    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))
    4343
    44 Bborie: A complete implementation of ST_Band should include the following:
     44A complete implementation of ST_Band should include the following:
    4545
    46461. ST_Band(rast raster, nbands int[]) -> raster
     
    9999If 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.
    100100
    101 ''' Open Question: ''' Should the function fail if an index is invalid?  How should this work when providing more than one indices to the function?
     101~~''' Open Question: ''' Should the function fail if an index is invalid?  How should this work when providing more than one indices to the function?~~
    102102
    103103----
     
    388388
    389389----
    390 '''Open Question:''' What if we want to export only the first two band of a three band layer?
    391 
    392 Maybe we need a ST_RasterFromBands(band1, band2, etc...) to reconstitute a multiband raster from multiple sources (having the same width, height, pixelsize, etc...)
    393 
    394 mloskot: or ST_RasterFromBands(bands) where bands is ARRAY[int]. For instance, ST_RasterFromBands(ARRAY[1,3]) will burn new raster from 1 and 3 bands of input raster.
     390~~'''Open Question:''' What if we want to export only the first two band of a three band layer?~~
     391
     392~~Maybe we need a ST_RasterFromBands(band1, band2, etc...) to reconstitute a multiband raster from multiple sources (having the same width, height, pixelsize, etc...)~~
     393
     394~~mloskot: or ST_RasterFromBands(bands) where bands is ARRAY[int]. For instance, ST_RasterFromBands(ARRAY[1,3]) will burn new raster from 1 and 3 bands of input raster.~~
    395395
    396396----
    397397'''ST_AsPNG(raster, band) -> PNG as "bytea"'''
    398398
    399 Bborie: Like the JPEG raster format, the PNG format has limitations:
     399Like the JPEG raster format, the PNG format has limitations:
    400400
    401401  1. PNG only allows 1 (greyscale) or 3 (RGB) bands of data
     
    479479Use GDAL to convert the raster into one of the format suported by GDAL.
    480480
    481 Bborie: this is a generic interface to outputting a supported and installed GDAL raster:
     481This is a generic interface to outputting a supported and installed GDAL raster:
    482482
    4834831. ST_AsGDALRaster(rast raster, format text, options text[], srs text) -> bytea