From: Regina Obe Date: Thu, 4 Oct 2012 04:08:36 +0000 (+0000) Subject: update st_union examples (single should always specify band number to be safe) and... X-Git-Tag: 2.1.0beta2~584 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bf0e2f1cde0acdcbca61e35d85577ed58e13c4e;p=postgis update st_union examples (single should always specify band number to be safe) and all bands can be done now with just union git-svn-id: http://svn.osgeo.org/postgis/trunk@10374 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index 6df0cbae3..67e129bec 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -8727,15 +8727,25 @@ UPDATE wind -- 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; Examples: Return a multi-band raster that is the union of tiles intersecting geometry - --- 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[]) + -- 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[] + SELECT ST_Union(rast) +FROM aerials.boston +WHERE ST_Intersects(rast, ST_GeomFromText('LINESTRING(230486 887771, 230500 88772)',26986) ); + + + Examples: Return a multi-band raster that is the union of tiles intersecting geometry + Here we use the longer syntax if we only wanted a subset of bands or we want to change order of bands + -- 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) ); @@ -8746,7 +8756,8 @@ WHERE ST_Intersects(rast, ST_GeomFromText('LINESTRING(230486 887771, 230500 887 , , - + , +