]> granicus.if.org Git - postgis/commitdiff
example of resample
authorRegina Obe <lr@pcorp.us>
Mon, 26 Dec 2011 11:04:30 +0000 (11:04 +0000)
committerRegina Obe <lr@pcorp.us>
Mon, 26 Dec 2011 11:04:30 +0000 (11:04 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8579 b70326c6-7e19-0410-871a-916f4a2858ee

doc/html/images/st_resample01.png [new file with mode: 0644]
doc/html/images/st_resample02.png [new file with mode: 0644]
doc/reference_raster.xml

diff --git a/doc/html/images/st_resample01.png b/doc/html/images/st_resample01.png
new file mode 100644 (file)
index 0000000..542ed20
Binary files /dev/null and b/doc/html/images/st_resample01.png differ
diff --git a/doc/html/images/st_resample02.png b/doc/html/images/st_resample02.png
new file mode 100644 (file)
index 0000000..828fa4e
Binary files /dev/null and b/doc/html/images/st_resample02.png differ
index eb6141a394e56c9ff37b3002a9e885ed0789808f..6cfee8918937e78b182a35fe011f02583175f456 100644 (file)
@@ -3468,18 +3468,54 @@ WHERE rid = 2;
                                <para>Warps a raster using specified pixel warping algorithm. 
                                    Uses 'NearestNeighbor' if no algorithm is specified and maxerror percent of 0.125 if no maxerr is specified.</para>
                                <para>Algorithm options are: 'NearestNeighbor', 'Bilinear', 'Cubic', 'CubicSpline', and 'Lanczos'.  Refer to: <ulink url="http://www.gdal.org/gdalwarp.html">GDAL Warp resampling methods</ulink> for more details. NearestNeighbor is the fastest but worst interpoloation</para>
+                               <note><para>Only works if rasters are in a known spatial reference system</para></note>
                                <para>Availability: 2.0.0  Requires GDAL 1.6.1+</para>
                        </refsection>
                                
                        <refsection>
                                        <title>Examples</title>
                                
-                                       <programlisting>-- TO DO --</programlisting>
+                                       <programlisting>SELECT ST_Width(orig) As orig_width, ST_Width(reduce_100) As new_width
+ FROM (
+ SELECT rast As orig, ST_Resample(rast,100,100) As reduce_100   
+  FROM aerials.boston 
+       WHERE ST_Intersects(rast,
+                               ST_Transform(ST_MakeEnvelope(-71.128, 42.2392,-71.1277, 42.2397, 4326),26986) ) limit 1 ) As foo;
+ orig_width | new_width
+------------+-------------
+        200 |         100                              
+</programlisting>
+<informaltable>
+       <tgroup cols="2">
+               <tbody>
+                       <row>
+                       <entry><informalfigure>
+                               <mediaobject>
+                                 <imageobject>
+                                       <imagedata fileref="images/rt_st_resample01.png" />
+                                 </imageobject>
+                                 <caption><para>original mass state plane meters (orig)</para></caption>
+                               </mediaobject>
+                         </informalfigure>
+                        </entry>
+                       <entry><informalfigure>
+                               <mediaobject>
+                                 <imageobject>
+                                       <imagedata fileref="images/rt_st_resample02.png" />
+                                 </imageobject>
+                                 <caption><para>resampled from 200x200 to 100x100</para></caption>
+                               </mediaobject>
+                         </informalfigure>
+                        </entry>
+                       </row>
+               </tbody>
+       </tgroup>
+</informaltable>
                        </refsection>
 
                        <refsection>
                                <title>See Also</title>
-                               <para><xref linkend="RT_ST_Transform" /></para>
+                               <para><xref linkend="RT_ST_Rescale" />, <xref linkend="RT_ST_Transform" /></para>
                        </refsection>
                </refentry>