[postgis-devel] [PostGIS] #1581: [raster] ST_Clip should not impose a nodata value when the source raster do not have one

PostGIS trac at osgeo.org
Wed Feb 15 12:04:41 PST 2012


#1581: [raster] ST_Clip should not impose a nodata value when the source raster do
not have one
-------------------------+--------------------------------------------------
 Reporter:  pracine      |       Owner:  pracine             
     Type:  enhancement  |      Status:  new                 
 Priority:  medium       |   Milestone:  PostGIS Raster 2.0.1
Component:  raster       |     Version:  trunk               
 Keywords:               |  
-------------------------+--------------------------------------------------
 In the case where:

 1) the input raster do not have a nodata value defined

 2) no alternative nodata values are provided

 The behavior right now is to set a nodata value to the resulting raster
 using ST_MinPossibleValue(ST_BandPixelType(rast)). We should not do
 that...

 Most users would expect to get a raster with no nodata value defined since
 this is what they provided. However in the case the geometry is not a
 rectangle aligned with the raster (e.g a circle), there must be a way to
 set some pixels to nodata.

 When the provided raster have a nodata defined, this nodata value is used.
 No problem.

 When an array of nodata value is provided, those nodata values are used.
 No problem.

 There is no such need in the case where the geometry is a rectangular
 fraction of the raster extent or when the geometry encompasses the raster
 and hence there is no need to set a nodata value in the resulting raster
 but we have no way to know that.

 When both of those conditions are not met (the provided raster do not have
 a nodata defined AND no array of nodata value is provided) and hence
 absolutely no nodata value is known, instead of imposing
 ST_MinPossibleValue() we should just NOTICE the user that we could not set
 a nodata value and that if he wants one to be defined he must use one of
 the variant accepting nodata values (or set a nodata value to its raster
 before clipping).

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