[postgis-devel] [PostGIS] #1139: [raster] Clamping should ignore nodata value

PostGIS trac at osgeo.org
Thu Jul 21 11:49:52 PDT 2011


#1139: [raster] Clamping should ignore nodata value
----------------------------+-----------------------------------------------
 Reporter:  pracine         |       Owner:  pracine              
     Type:  enhancement     |      Status:  new                  
 Priority:  medium          |   Milestone:  PostGIS Raster Future
Component:  postgis raster  |     Version:  trunk                
 Keywords:                  |  
----------------------------+-----------------------------------------------
 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.

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