]> granicus.if.org Git - postgis/commitdiff
Fix for ticket #1589. Removed misleading example.
authorPierre Racine <Pierre.Racine@sbf.ulaval.ca>
Fri, 2 Mar 2012 20:14:49 +0000 (20:14 +0000)
committerPierre Racine <Pierre.Racine@sbf.ulaval.ca>
Fri, 2 Mar 2012 20:14:49 +0000 (20:14 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9387 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_raster.xml

index 3f0ecf6344bbf32582b118bf48fe8b21d8d9ca76..69468e52db1f4373a1edf8246cbffc3085ac9802 100644 (file)
@@ -3706,60 +3706,19 @@ WHERE rid = 2;
                                        <para>A simple example rescaling a raster from a pixel size of 0.001 degree to a pixel size of 0.0015 degree.</para>
                                        
                                        <programlisting>-- the original raster pixel size
-SELECT ST_PixelWidth(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0))
-                                       
+SELECT ST_PixelWidth(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0)) width
+
+   width
+----------
+0.001
+
 -- the rescaled raster raster pixel size
-SELECT ST_PixelWidth(ST_Rescale(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0), 0.0015))</programlisting>
-                                       
-                                       <para>This example utilize the katrina raster loaded as a single tile described in 
-                       <ulink url="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html">http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html</ulink></para>
-                                       <programlisting>-- My original raster that is in WGS 84 lon lat 1 pixel in x/y represents 0.029.. in long lat -
-SELECT ST_ScaleX(rast) As orig_scalex, ST_ScaleY(rast) As origi_scaley 
- FROM katrina;
-                                       
-       orig_scalex     |    origi_scaley
---------------------+---------------------
- 0.0293255131964809 | -0.0293255131964809
- --I create a table of 2 rasters one 25% of original and one 75% of original
- CREATE TABLE katrinas_rescaled(rid serial primary key, descrip text, rast raster);
+SELECT ST_PixelWidth(ST_Rescale(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0), 0.0015)) width
 
- INSERT INTO katrinas_rescaled(descrip, rast)
- SELECT 'rescaled ' || round((1.0/i*100), 2)::text || '%', ST_Rescale(rast, ST_ScaleX(rast)*i, ST_ScaleY(rast)*i)
-       FROM katrina CROSS JOIN generate_series(6, 8, 2) As i;
-                                       
-SELECT descrip, ST_ScaleX(rast) As newsx, ST_ScaleY(rast) As newsy
-       FROM katrinas_rescaled;
-       
-    descrip     |       newsx       |       newsy
-----------------+-------------------+--------------------
- rescaled 16.67% | 0.175953079178886 | -0.175953079178886
- rescaled 12.50% | 0.234604105571848 | -0.234604105571848
-                                       </programlisting>
-                               <informaltable>
-                                       <tgroup cols="2">
-                                               <tbody>
-                                                       <row>
-                                                               <entry><informalfigure>
-                                                                       <mediaobject>
-                                                                               <imageobject>
-                                                                                       <imagedata fileref="images/st_rescale01.png" />
-                                                                               </imageobject>
-                                                                               <caption><para>at 16.67% size of original</para></caption>
-                                                                       </mediaobject>
-                                                               </informalfigure></entry>
-                                                               <entry><informalfigure>
-                                                                       <mediaobject>
-                                                                               <imageobject>
-                                                                                       <imagedata fileref="images/st_rescale02.png" />
-                                                                               </imageobject>
-                                                                               <caption><para>at 12.50% size of original</para></caption>
-                                                                       </mediaobject>
-                                                               </informalfigure></entry>
-                                                       </row>
-                                               </tbody>
-                                       </tgroup>
-                               </informaltable>
+   width
+----------
+0.0015
+</programlisting>                              
                        </refsection>
 
                        <refsection>