Ticket #1139 (closed defect: fixed)
[raster] Values, when clamped, should not be set to nodata value
| Reported by: | pracine | Owned by: | dustymugs |
|---|---|---|---|
| Priority: | medium | Milestone: | PostGIS 2.0.0 |
| Component: | raster | Version: | trunk |
| Keywords: | Cc: |
Description
When clamping values, if the clamped value becomes equal to the nodata value, it should be incremented or decremented by 1.
For example, setting 2 in a 1BB raster having 0 as nodata value:
SELECT ST_Value(ST_SetValue(ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, -1), '1BB'::text, 1, 0), 1, 1, 2),1, 1)
works fine but setting -1 in the same raster stores a nodata value:
SELECT ST_Value(ST_SetValue(ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, -1), '1BB'::text, 1, 0), 1, 1, -1),1, 1)
should return 1, not NULL.
Nodata values should be set only when explicitly setting the exact nodata value (in this case 0) or NULL. Other values must be clamped to something different than the nodata value.
Change History
Note: See
TracTickets for help on using
tickets.
