]> granicus.if.org Git - postgis/commitdiff
Document how to define a raster layer in Mapserver
authorRegina Obe <lr@pcorp.us>
Wed, 14 Apr 2010 11:40:28 +0000 (11:40 +0000)
committerRegina Obe <lr@pcorp.us>
Wed, 14 Apr 2010 11:40:28 +0000 (11:40 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@5543 b70326c6-7e19-0410-871a-916f4a2858ee

doc/faq_wktraster.xml

index 181b74070b1f72f19648bdbee549c28a46cb2ffb..fb24a0d5fc805631cfa6813d8735aaaad24bd298 100644 (file)
                 <para>To see more examples and syntax refer to <ulink url="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html#a3.2-Readingdata">Reading Raster Data of PostGIS WKT Raster section</ulink></para>
       </answer>
     </qandaentry>
+    
+    <qandaentry>
+      <question>
+        <para>What tools can I use to view PostGIS raster data?</para>
+      </question>
+
+      <answer>
+        <para>You can use MapServer compiled with GDAL 1.7+ and PostGIS WKT Raster driver support to view Raster data.  In
+               theory any tool that renders data using GDAL can support PostGIS raster data or support it with fairly minimal effort.</para>
+      </answer>
+    </qandaentry>
+    
+    <qandaentry>
+      <question>
+        <para>How can I add a PostGIS raster layer to my Mapserver map.</para>
+      </question>
+
+      <answer>
+        <para>You can much like you can with any other raster.  Refer to <ulink url="http://mapserver.org/input/raster.html">Mapserver Raster processing options</ulink>
+        for list of various processing functions you can use with Mapserver raster layers.</para>
+        <para>What makes PostGIS raster data particularly interesting, is that since each tile can have various standard database columns, you can segment it in your data source</para>
+        <para>Below is an example of how you would defined a PostGIS raster layer in Mapserver.</para>
+        <programlisting>
+-- displaying raster with standard raster options
+LAYER
+       NAME coolwktraster
+       TYPE raster
+       STATUS ON
+       DATA "PG:host=localhost port=5432 dbname='somedb' user='someuser' password='whatever' schema='someschema' table='cooltable'"    
+       PROCESSING "NODATA=0"
+       PROCESSING "SCALE=AUTO"
+       #... other standard raster processing functions here
+       #... classes are optional but useful for 1 band data
+       CLASS
+               NAME "boring"
+               EXPRESSION ([pixel] &lt; 20)
+               COLOR 250 250 250
+       END
+       CLASS
+               NAME "mildly interesting"
+               EXPRESSION ([pixel] &gt; 20 AND [pixel] &lt; 1000)
+               COLOR 255 0 0
+       END
+       CLASS
+               NAME "very interesting"
+               EXPRESSION ([pixel] &gt;= 1000)
+               COLOR 0 255 0
+       END
+END
+        </programlisting>
+        
+        <programlisting>
+-- displaying raster with standard raster options and a where clause
+LAYER
+       NAME soil_survey2009
+       TYPE raster
+       STATUS ON
+       DATA "PG:host=localhost port=5432 dbname='somedb' user='someuser' password='whatever' schema='someschema' table='cooltable' where='survey_year=2009'"   
+       PROCESSING "NODATA=0"
+       PROCESSING "SCALE=AUTO"
+       #... other standard raster processing functions here
+       #... classes are optional but useful for 1 band data
+END
+        </programlisting>
+        
+      </answer>
+    </qandaentry>
+    
        
        <qandaentry>
       <question>