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]]~~ |
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.~~ |
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.~~ |