From: Regina Obe Date: Wed, 22 Feb 2012 03:09:12 +0000 (+0000) Subject: correct st_clip raster so eimage matches the code. the behavior changed butthe code... X-Git-Tag: 2.0.0alpha6~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b46d80c82786840596f800664e90ef066db3fbc;p=postgis correct st_clip raster so eimage matches the code. the behavior changed butthe code was wrong (showing old behavior). Also put back the multiband case using new syntax which is probably more common usaage. git-svn-id: http://svn.osgeo.org/postgis/trunk@9251 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index 4364f870b..c3463c609 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -5155,7 +5155,7 @@ rid | rastbox Examples: 1 band clipping -- Clip the first band of an aerial tile by a 20 meter buffer. -SELECT ST_Clip(rast, +SELECT ST_Clip(rast, 1, ST_Buffer(ST_Centroid(ST_Envelope(rast)),20) ) from aerials.boston WHERE rid = 4; @@ -5163,9 +5163,9 @@ WHERE rid = 4; -- Demonstrate effect of trimraster on final dimensions of raster -- Note how in trimmed final envelope is clipped to that of the clipper -- if trimraster = true -SELECT ST_XMax(ST_Envelope(ST_Clip(rast,clipper,true))) As xmax_w_trim, +SELECT ST_XMax(ST_Envelope(ST_Clip(rast,1,clipper,true))) As xmax_w_trim, ST_XMax(clipper) As xmax_clipper, - ST_XMax(ST_Envelope(ST_Clip(rast,clipper,false))) As xmax_wo_trim, + ST_XMax(ST_Envelope(ST_Clip(rast,1,clipper,false))) As xmax_wo_trim, ST_XMax(ST_Envelope(rast)) As xmax_rast_orig FROM (SELECT rast, ST_Buffer(ST_Centroid(ST_Envelope(rast)),6) As clipper FROM aerials.boston @@ -5200,6 +5200,43 @@ WHERE rid = 6) As foo; + + + + Examples: Clip all bands +-- Clip all bands of an aerial tile by a 20 meter buffer. +-- Only difference is we don't specify a specific band to clip +-- so all bands are clipped +SELECT ST_Clip(rast, + ST_Buffer(ST_Centroid(ST_Envelope(rast)),20) + ) from aerials.boston +WHERE rid = 4; + + + + + + + + + + + Full raster tile before clipping + + + + + + + + + After Clipping + + + + + +