]> granicus.if.org Git - postgis/commitdiff
update st_union examples (single should always specify band number to be safe) and...
authorRegina Obe <lr@pcorp.us>
Thu, 4 Oct 2012 04:08:36 +0000 (04:08 +0000)
committerRegina Obe <lr@pcorp.us>
Thu, 4 Oct 2012 04:08:36 +0000 (04:08 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10374 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_raster.xml

index 6df0cbae32f287b19d3533e024e7697221e2740e..67e129beca65e0b0e57ee97b4c2e6896f950d1cb 100644 (file)
@@ -8727,15 +8727,25 @@ UPDATE wind
                                <programlisting>
 -- this creates a single band from first band of raster tiles
 -- that form the original file system tile
-SELECT filename, ST_Union(rast) As file_rast
+SELECT filename, ST_Union(rast,1) As file_rast
 FROM sometable WHERE filename IN('dem01', 'dem02') GROUP BY filename;</programlisting>
                        </refsection>
                        
                        <refsection>
                                <title>Examples: Return a multi-band raster that is the union of tiles intersecting geometry</title>
-                               <programlisting>
--- this creates a multi band raster collecting all the tiles that intersect a line
-SELECT ST_Union(rast,ARRAY[ROW(1, 'LAST'), ROW(2, 'LAST'), ROW(3, 'LAST')]::unionarg[])
+                               <para>-- this creates a multi band raster collecting all the tiles that intersect a line
+-- Note: In 2.0, this would have just returned a single band raster
+-- , new union works on all bands by default
+-- this is equivalent to unionarg: ARRAY[ROW(1, 'LAST'), ROW(2, 'LAST'), ROW(3, 'LAST')]::unionarg[] </para>
+                               <programlisting>SELECT ST_Union(rast)
+FROM aerials.boston
+WHERE ST_Intersects(rast,  ST_GeomFromText('LINESTRING(230486 887771, 230500 88772)',26986) );</programlisting>
+                       </refsection>
+                       <refsection>
+                               <title>Examples: Return a multi-band raster that is the union of tiles intersecting geometry</title>
+                               <para>Here we use the longer syntax if we only wanted a subset of bands or we want to change order of bands</para>
+                               <programlisting>-- this creates a multi band raster collecting all the tiles that intersect a line
+SELECT ST_Union(rast,ARRAY[ROW(2, 'LAST'), ROW(1, 'LAST'), ROW(3, 'LAST')]::unionarg[])
 FROM aerials.boston
 WHERE ST_Intersects(rast,  ST_GeomFromText('LINESTRING(230486 887771, 230500 88772)',26986) );</programlisting>
                        </refsection>
@@ -8746,7 +8756,8 @@ WHERE ST_Intersects(rast,  ST_GeomFromText('LINESTRING(230486 887771, 230500 887
                                <para>
                                        <xref linkend="unionarg" />, 
                                        <xref linkend="RT_ST_Envelope" />, 
-                                       <xref linkend="RT_ST_ConvexHull" />
+                                       <xref linkend="RT_ST_ConvexHull" />,
+                                       <xref linkend="RT_ST_Clip" />
                                </para>
                        </refsection>
                </refentry>