]> granicus.if.org Git - postgis/commitdiff
#2290 provide visual example of color map
authorRegina Obe <lr@pcorp.us>
Fri, 10 May 2013 06:57:54 +0000 (06:57 +0000)
committerRegina Obe <lr@pcorp.us>
Fri, 10 May 2013 06:57:54 +0000 (06:57 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11394 b70326c6-7e19-0410-871a-916f4a2858ee

doc/html/images/st_colormap_grey.png [new file with mode: 0644]
doc/html/images/st_colormap_orig.png [new file with mode: 0644]
doc/html/images/st_colormap_pseudo.png [new file with mode: 0644]
doc/reference_raster.xml

diff --git a/doc/html/images/st_colormap_grey.png b/doc/html/images/st_colormap_grey.png
new file mode 100644 (file)
index 0000000..ae6bd8a
Binary files /dev/null and b/doc/html/images/st_colormap_grey.png differ
diff --git a/doc/html/images/st_colormap_orig.png b/doc/html/images/st_colormap_orig.png
new file mode 100644 (file)
index 0000000..f439df0
Binary files /dev/null and b/doc/html/images/st_colormap_orig.png differ
diff --git a/doc/html/images/st_colormap_pseudo.png b/doc/html/images/st_colormap_pseudo.png
new file mode 100644 (file)
index 0000000..7562a05
Binary files /dev/null and b/doc/html/images/st_colormap_pseudo.png differ
index f4ba7c8d3b80d61fc6a05ffccf22f7b498bf2c6f..9e2f709db324a2ac98aed908b6531a85aab3d95a 100644 (file)
@@ -10878,17 +10878,83 @@ nv 0 0 0 0
 
                        <refsection>
                                <title>Examples</title>
-                               <para></para>
+                               <para>This is a junk table to play with</para>
                                <programlisting>
--- needs examples
-                               </programlisting>                       
+-- setup test raster table --
+DROP TABLE IF EXISTS funky_shapes;
+CREATE TABLE funky_shapes(rast raster);
+INSERT INTO funky_shapes(rast)
+WITH ref As ( 
+       SELECT ST_MakeEmptyRaster( 200, 200, 0, 200, 1, -1, 0, 0) As rast
+       )
+SELECT ST_Union(rast)
+FROM (SELECT 
+  ST_AsRaster(
+    ST_Rotate(ST_Buffer(
+               ST_GeomFromText('LINESTRING(0 2,50 50,150 150,125 50)'), i*2
+        ), pi()*i*0.125, ST_Point(50,50))
+       , ref.rast, '8BUI'::text, i*5) As rast
+       FROM ref cross JOIN generate_series(1,10,3) As i ) As shapes ;</programlisting>
+<programlisting>SELECT ST_NumBands(rast) As n_orig
+   , ST_NumBands(ST_ColorMap(rast, 'pseudocolor')) As npseudo
+   , ST_NumBands(ST_ColorMap(rast, 'greyscale')) As ngrey
+FROM funky_shapes;
+
+ n_orig | npseudo | ngrey
+--------+---------+-------
+      1 |       4 |     1
+</programlisting>                      
+                       </refsection>
+                       <refsection><title>Examples: Compare different color map looks using ST_AsPNG</title>
+                               <programlisting>SELECT ST_AsPNG(rast) As orig_png
+ , ST_AsPNG(ST_ColorMap(rast,'greyscale')) As grey_png
+ , ST_AsPNG(ST_ColorMap(rast, 'pseudocolor')) As pseudo_png
+FROM funky_shapes;</programlisting>
+
+<informaltable>
+  <tgroup cols="3">
+       <tbody>
+         <row>
+               <entry><para><informalfigure>
+                       <mediaobject>
+                         <imageobject>
+                               <imagedata fileref="images/st_colormap_orig.png" />
+                         </imageobject>
+                         <caption><para>orig_png</para></caption>
+                       </mediaobject>
+                 </informalfigure></para>
+                </entry>
+               <entry><para><informalfigure>
+                       <mediaobject>
+                         <imageobject>
+                               <imagedata fileref="images/st_colormap_grey.png" />
+                         </imageobject>
+                         <caption><para>grey_png</para></caption>
+                       </mediaobject>
+                 </informalfigure></para>
+                </entry>
+               <entry><para><informalfigure>
+                       <mediaobject>
+                         <imageobject>
+                               <imagedata fileref="images/st_colormap_pseudo.png" />
+                         </imageobject>
+                         <caption><para>pseudo_png</para></caption>
+                       </mediaobject>
+                 </informalfigure></para>
+                </entry>
+               </row>
+       </tbody>
+</tgroup>
+</informaltable>
                        </refsection>
 
                        <refsection>
                                <title>See Also</title>
                                <para>
                                        <xref linkend="RT_ST_MapAlgebra" />, 
-                                       <xref linkend="RT_ST_Reclass" />
+                                       <xref linkend="RT_ST_Reclass" />,
+                                       <xref linkend="RT_ST_AsPNG" />,
+                                       <xref linkend="RT_ST_AsRaster" />
                                </para>
                        </refsection>
                </refentry>