[postgis-devel] [PostGIS] #552: [wktraster] ST_SetValue is changing the raster

PostGIS trac at osgeo.org
Tue Jul 27 11:15:05 PDT 2010


#552: [wktraster] ST_SetValue is changing the raster
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey        
     Type:  defect   |      Status:  new            
 Priority:  medium   |   Milestone:  WKTRaster 0.1.6
Component:  postgis  |     Version:  1.5.X          
 Keywords:           |  
---------------------+------------------------------------------------------
 I'm not sure if this is a bug or not, but it is inconsistent with the way
 PostGIS functions, other raster functions and all PostgreSQL functions I
 know about work.

 When I do this

 {{{
 SELECT (foo.geomval).val, ST_AsText(ST_Union((foo.geomval).geom))
 FROM (SELECT ST_DumpAsPolygons(ST_SetValue(rast,1,ST_Point(3427927.75,
 5793243.95),50)) As geomval
 FROM dummy_rast
 where rid = 2) As foo
 WHERE (foo.geomval).val < 250
 GROUP BY (foo.geomval).val;
 }}}

 And then do this


 {{{
 SELECT (foo.geomval).val, ST_AsText(ST_Union((foo.geomval).geom))
 FROM (SELECT ST_DumpAsPolygons(rast,1) As geomval
 FROM dummy_rast
 where rid = 2) As foo
 WHERE (foo.geomval).val < 250
 GROUP BY (foo.geomval).val;
 }}}

 I'm seeing that the underlying raster has changed value since both give
 the same answer.

 I would expect to have to do this:

 {{{
 UPDATE dummy_rast SET rast =   ST_SetValue(rast,1,ST_Point(3427927.75,
 5793243.95),50)
 }}}


 I suppose its more efficient this way, but wondering if it may not be
 better to call this inplace edit or something else -- so people don't
 assume it behaves like all the other ST_Set/ST_Add functions

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/552>
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