]> granicus.if.org Git - postgis/commitdiff
example for ST_DumpAsPolygons
authorRegina Obe <lr@pcorp.us>
Fri, 30 Apr 2010 16:17:18 +0000 (16:17 +0000)
committerRegina Obe <lr@pcorp.us>
Fri, 30 Apr 2010 16:17:18 +0000 (16:17 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@5591 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_wktraster.xml

index bf39d368e81d7bd4999fffb0b3ba845247ddecbb..7dd3bb66d39a072cc44ecda61650f86727ef9c21 100644 (file)
@@ -1860,14 +1860,31 @@ FROM (SELECT ST_SetRotation(rast,0.1,0.1) As rast
                                reverse of a GROUP BY in that it creates new rows. For example it
                                can be used to expand a single raster into multiple POLYGONS/MULTIPOLYGONS.</para>
        
-                               <para>Availability: Requires GDAL 1.6 or higher.</para>
+                               <para>Availability: Requires GDAL 1.6.1 or higher.</para>
                                <note><para>Still under development and testing.</para></note>
                  </refsection>
        
                  <refsection>
                        <title>Examples</title>
-               <programlisting><!-- TODO: need examples --> 
-                       Forthcoming
+               <programlisting>SELECT val, ST_AsText(geom) As geomwkt
+FROM (
+SELECT (ST_DumpAsPolygons(rast)).*
+FROM dummy_rast 
+WHERE rid = 2
+) As foo
+WHERE val BETWEEN 249 and 251
+ORDER BY val;
+
+ val |                                                       geomwkt
+-----+--------------------------------------------------------------------------
+ 249 | POLYGON((3427927.95 5793243.95,3427927.95 5793243.85,3427928 5793243.85,
+               3427928 5793243.95,3427927.95 5793243.95))
+ 250 | POLYGON((3427927.75 5793243.9,3427927.75 5793243.85,3427927.8 5793243.85,
+               3427927.8 5793243.9,3427927.75 5793243.9))
+ 250 | POLYGON((3427927.8 5793243.8,3427927.8 5793243.75,3427927.85 5793243.75,
+               3427927.85 5793243.8, 3427927.8 5793243.8))
+ 251 | POLYGON((3427927.75 5793243.85,3427927.75 5793243.8,3427927.8 5793243.8,
+               3427927.8 5793243.85,3427927.75 5793243.85))
                </programlisting>
                  </refsection>
                  <refsection>