cough cough: New docs http://postgis.net/docs/manual-dev/RT_ST_AddBand.html -Regina
_____ From: [email protected] [mailto:[email protected]] On Behalf Of Bborie Park Sent: Monday, July 08, 2013 12:38 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] Creating a multiband raster from 3 single bandrasters Check out the last example (Multi-band versions) of ST_AddBand(). http://postgis.refractions.net/documentation/manual-svn/RT_ST_AddBand.html -bborie On Sun, Jul 7, 2013 at 8:43 PM, Mark Wynter <[email protected]> wrote: I'm hoping someone can suggest a way of efficiently combining 3 individual (but concordant) single band rasters into single raster having 3 bands? We're working with PostgreSQL9.1, PostGIS2.1Beta. The starting point is a single tiled raster with 3 bands representing RGB values. Let's say we perform some color smoothing on each of the RGB bands using mapalgebra. CREATE TABLE resample_myrastertable_b1 AS SELECT rid, st_mapalgebrafctngb(rast, 1, '8BUI', 5, 5, 'st_mean4ma(float[][],text,text[])'::regprocedure, 'ignore', NULL) as rast FROM original_rastertable; CREATE TABLE resample_myrastertable_b2 AS SELECT rid, st_mapalgebrafctngb(rast, 2, '8BUI', 5, 5, 'st_mean4ma(float[][],text,text[])'::regprocedure, 'ignore', NULL) as rast FROM original_rastertable; CREATE TABLE resample_myrastertable_b3 AS SELECT rid, st_mapalgebrafctngb(rast, 3, '8BUI', 5, 5, 'st_mean4ma(float[][],text,text[])'::regprocedure, 'ignore', NULL) as rast FROM original_rastertable; This gives us 3 single-band results rasters. How do we now join the individual smoothed RGB "results" rasters into a single multiband "results" raster? We'd also like to add a 4th band to the "results" raster based on say a calculation which references the smoothed values in bands 1-3. I'm getting reasonably comfortable writing MapAlgebra callback expressions. Its more a case of how do we efficiently handle table operations (e.g. appending single band raster outputs) each time we perform some MapAlgebra? Any suggestions and or a simple worked example would be most appreciated. Many thanks Mark _______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
_______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
