[postgis-devel] [PostGIS] #297: [wktraster] Implement ST_DumpAsPolygons function for raster

PostGIS trac at osgeo.org
Mon May 3 12:45:47 PDT 2010


#297: [wktraster] Implement ST_DumpAsPolygons function for raster
------------------------+---------------------------------------------------
  Reporter:  mloskot    |       Owner:  jorgearevalo   
      Type:  task       |      Status:  assigned       
  Priority:  high       |   Milestone:  WKTRaster 0.1.6
 Component:  wktraster  |     Version:  trunk          
Resolution:             |    Keywords:                 
------------------------+---------------------------------------------------
Comment (by robe):

 Jorge,

 For your r5605 -- may I be so bold as to suggest you use ST_Union instead
 of ST_Collect.  ST_Collect may be faster but I think you will end up with
 many invalid polygons.  Though in this example ST_Union is faster (I guess
 because of the new cascaded union feature)

 For example

 -- Takes 4.2 seconds
 {{{
 SELECT rid,ST_IsValid(ST_Collect(geom)) As geom
 FROM (SELECT rid, (ST_DumpAsPolygons(rast,1)).*
 FROM ch13.usdem WHERE rid = 1) As foo
 WHERE val <> 0
 GROUP BY rid
 }}}


 Gives false

 -- Takes 3.8 seconds
 {{{
 SELECT rid,ST_IsValid(ST_Union(geom)) As geom
 FROM (SELECT rid, (ST_DumpAsPolygons(rast,1)).*
 FROM ch13.usdem WHERE rid = 1) As foo
 WHERE val <> 0
 GROUP BY rid


 }}}

 Gives true

 to union the whole set above takes about 5 minutes.  It looks about right
 though and didn't give any errors.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/297#comment:33>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list