]> granicus.if.org Git - postgis/commitdiff
correct st_clip raster so eimage matches the code. the behavior changed butthe code...
authorRegina Obe <lr@pcorp.us>
Wed, 22 Feb 2012 03:09:12 +0000 (03:09 +0000)
committerRegina Obe <lr@pcorp.us>
Wed, 22 Feb 2012 03:09:12 +0000 (03:09 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9251 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_raster.xml

index 4364f870b20f668a68f43f6741da6d8a92775f58..c3463c609d74eab97f1ccbb909183a3050dc2df7 100644 (file)
@@ -5155,7 +5155,7 @@ rid |        rastbox
                        <refsection>
                                <title>Examples: 1 band clipping</title>                                
 <programlisting>-- 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;</programlisting>
@@ -5163,9 +5163,9 @@ WHERE rid = 4;</programlisting>
 <programlisting>-- 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;
                </row>
        </tbody>
 </tgroup>
+</informaltable>
+                       </refsection>
+                       <refsection>
+                               <title>Examples: Clip all bands</title>                         
+<programlisting>-- 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;</programlisting>
+
+<informaltable>
+  <tgroup cols="2">
+       <tbody>
+         <row>
+               <entry><informalfigure>
+                       <mediaobject>
+                         <imageobject>
+                               <imagedata fileref="images/st_clip01.png" />
+                         </imageobject>
+                         <caption><para>Full raster tile before clipping</para></caption>
+                       </mediaobject>
+                 </informalfigure>
+                </entry>
+               <entry><informalfigure>
+                       <mediaobject>
+                         <imageobject>
+                               <imagedata fileref="images/st_clip03.png" />
+                         </imageobject>
+                         <caption><para>After Clipping</para></caption>
+                       </mediaobject>
+                 </informalfigure>
+                </entry>
+               </row>
+       </tbody>
+</tgroup>
 </informaltable>
                        </refsection>
                        <!-- Optionally add a "See Also" section -->