Ticket #552 (closed defect: fixed)
[wktraster] ST_SetValue is changing the raster
| Reported by: | robe | Owned by: | pracine |
|---|---|---|---|
| Priority: | medium | Milestone: | WKTRaster 0.1.6 |
| Component: | raster | Version: | 1.5.X |
| Keywords: | Cc: |
Description
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
Change History
Note: See
TracTickets for help on using
tickets.
