<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 10.00.9200.16618"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=726554905-08072013><FONT color=#0000ff
size=2 face=Arial>cough cough: New docs</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=726554905-08072013><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=726554905-08072013><FONT color=#0000ff
size=2 face=Arial><A
href="http://postgis.net/docs/manual-dev/RT_ST_AddBand.html">http://postgis.net/docs/manual-dev/RT_ST_AddBand.html</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=726554905-08072013><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=726554905-08072013><FONT color=#0000ff
size=2 face=Arial>-Regina</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=726554905-08072013><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV><BR>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> postgis-users-bounces@lists.osgeo.org
[mailto:postgis-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Bborie
Park<BR><B>Sent:</B> Monday, July 08, 2013 12:38 AM<BR><B>To:</B> PostGIS Users
Discussion<BR><B>Subject:</B> Re: [postgis-users] Creating a multiband raster
from 3 single bandrasters<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>Check out the last example (Multi-band versions) of ST_AddBand().
<DIV><BR></DIV>
<DIV><A
href="http://postgis.refractions.net/documentation/manual-svn/RT_ST_AddBand.html">http://postgis.refractions.net/documentation/manual-svn/RT_ST_AddBand.html</A><BR></DIV>
<DIV><BR></DIV>
<DIV>-bborie</DIV></DIV>
<DIV class=gmail_extra><BR><BR>
<DIV class=gmail_quote>On Sun, Jul 7, 2013 at 8:43 PM, Mark Wynter <SPAN
dir=ltr><<A href="mailto:mark@dimensionaledge.com"
target=_blank>mark@dimensionaledge.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">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.<BR><BR>The starting point is a
single tiled raster with 3 bands representing RGB values.<BR><BR>Let's say we
perform some color smoothing on each of the RGB bands using
mapalgebra.<BR><BR>CREATE TABLE resample_myrastertable_b1 AS<BR>SELECT rid,
st_mapalgebrafctngb(rast, 1, '8BUI', 5, 5,
'st_mean4ma(float[][],text,text[])'::regprocedure, 'ignore', NULL) as rast
FROM original_rastertable;<BR><BR>CREATE TABLE resample_myrastertable_b2
AS<BR>SELECT rid, st_mapalgebrafctngb(rast, 2, '8BUI', 5, 5,
'st_mean4ma(float[][],text,text[])'::regprocedure, 'ignore', NULL) as rast
FROM original_rastertable;<BR><BR>CREATE TABLE resample_myrastertable_b3
AS<BR>SELECT rid, st_mapalgebrafctngb(rast, 3, '8BUI', 5, 5,
'st_mean4ma(float[][],text,text[])'::regprocedure, 'ignore', NULL) as rast
FROM original_rastertable;<BR><BR>This gives us 3 single-band results
rasters.<BR><BR>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.<BR><BR>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?<BR><BR>Any suggestions and or a
simple worked example would be most appreciated.<BR><BR>Many
thanks<BR><BR>Mark<BR><BR><BR><BR><BR>_______________________________________________<BR>postgis-users
mailing list<BR><A
href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</A><BR><A
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users"
target=_blank>http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</A><BR></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>