]> granicus.if.org Git - postgis/commitdiff
describe the example a bit better for ST_AddBand multi-band example
authorRegina Obe <lr@pcorp.us>
Sat, 10 Dec 2011 16:55:38 +0000 (16:55 +0000)
committerRegina Obe <lr@pcorp.us>
Sat, 10 Dec 2011 16:55:38 +0000 (16:55 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8346 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_raster.xml

index c5d08fcba8a32016232f7e1cf4412325ca35c92f..acf7d2f3d543380724686db88b3e9e39a691e09e 100644 (file)
@@ -1155,10 +1155,15 @@ FROM (SELECT ST_MetaData(rast) As rmd
                        <refsection>
                                        <title>Examples: Multi-Band versions</title>
                                
-                                       <programlisting>-- Aggregate a bunch of rasters 1st bands into a single band rast
--- not the rasters must be aligned.
-SELECT ST_AddBand(NULL, array_agg(rast), 1 ) As rast 
-                       FROM some_rast_table;   
+                                       <programlisting>-- Aggregate the 1st band of a table of like rasters into a single raster 
+-- with as many bands as there are test_types and as many rows as there are time_slots
+-- NOTE: The ORDER BY test_type is only supported in PostgreSQL 9.0
+-- for 8.4 and below it usually works to order your data in a subselect (but not guaranteed)
+-- The resulting raster will have a band for each test_type alphabetical by test_type
+-- For mouse lovers: No mice were harmed in this exercise
+SELECT rabbit, ST_AddBand(NULL, array_agg(rast ORDER BY test_type), 1 ) As rast 
+       FROM mice_studies
+                       GROUP BY mice;  
                                        </programlisting>
                        
                        </refsection>