Ticket #1245 (closed enhancement: fixed)
[raster] ST_AddBand that can build a multi band raster from an array of raster bands
| Reported by: | robe | Owned by: | pracine |
|---|---|---|---|
| Priority: | medium | Milestone: | PostGIS 2.0.0 |
| Component: | raster | Version: | trunk |
| Keywords: | Cc: |
Description
It's been bugging me for a while that a lot of code we have for adding multiple bands to a raster looks like this:
ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(100,100,0,0,1,-1,0,0, -1), '1BB'), '4BUI') ;
There are two issues I see with this calling of multiple ST_AddBand 1) Each call I can only assume requires a memcopy of the previous raster which would be avoided if you can pass all the bands in a single call.
2) It's kinda long to type
Overloading the ST_AddBand I think will get problematic with casting of arrays etc.
But perhaps an ST_AddMultiBand or something like that
Which will 1) Have a proto to allow you to add a range of bands from one raster to another
kind of like ST_Band().. so I could do something like
ST_AddMultiBand(newrast, ST_Band(oldrast,ARRAY[1,4]) )
or
ST_AddMultiBand(newrast, ARRAY['8BUI', '8BUI'])
etc.
