Opened 14 years ago
Closed 14 years ago
#606 closed enhancement (fixed)
[raster] ST_Value should return NULL for nodata values
Reported by: | pracine | Owned by: | pracine |
---|---|---|---|
Priority: | critical | Milestone: | PostGIS 2.0.0 |
Component: | raster | Version: | master |
Keywords: | Cc: |
Description
There is two options for returning nodata values.
1) Nodata values are REAL nodata values and there is NO value, period. In this case ST_Value should return NULL.
2) We want to be able to do computation with nodata values. In this case ST_Value should return the nodata value.
Up to now I have a strong preference for 2) and plan to change the behavior of ST_Value. Still thinking about the impacts though…
Change History (4)
comment:1 by , 14 years ago
Status: | new → assigned |
---|
comment:2 by , 14 years ago
Priority: | medium → critical |
---|
comment:3 by , 14 years ago
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
-Fix at r6680
ST_Value now return NULL for nodata value and ST_SetValue accept NULL values (if there is a nodata value in the band).
ST_Value accept a boolean parameter which, when set to false, have the function to return nodata values as their true value instead of null.
Some plpgsql scripts will have to be updated.
There should be a boolean option to disable this behavior and return the true value of a nodata value pixel if required.
ST_Value(rast, x, y, FALSE)
In this case FALSE means "ignore the nodata value flag" or "do not take nodata value into account and treat any nodata value like withdata values".
By default the boolean option is TRUE and the function returns NULL (if the value is nodata).
This boolean option have the same meaning as the one in st_intersects and should be generalize to every fucntion when we want it to ignore nodata values.