[postgis-tickets] [PostGIS] #2341: [raster] ST_MapAlgebra mask parameter (was: [raster] st_mapalgebra mask parameter)

PostGIS trac at osgeo.org
Wed May 29 10:48:01 PDT 2013


#2341: [raster] ST_MapAlgebra  mask parameter
-------------------------+--------------------------------------------------
 Reporter:  nclay        |       Owner:  dustymugs    
     Type:  enhancement  |      Status:  assigned     
 Priority:  medium       |   Milestone:  PostGIS 2.2.0
Component:  raster       |     Version:  trunk        
 Keywords:               |  
-------------------------+--------------------------------------------------
Changes (by dustymugs):

  * status:  new => assigned
  * milestone:  PostGIS Future => PostGIS 2.2.0


Comment:

 New variants using a mask and weight flag parameters instead of distancex
 and distancey.

 weight parameter is a boolean flag indicating that the values in mask are
 weights that should be applied to the pixel values.

 The mask would be a 2D double precision array of the neighborhood. The
 length along the X and Y axes must be at least one AND an odd number. The
 length must be odd as otherwise, where in the mask is the element for the
 center pixel (pixel of interest)?

 A valid mask...
 {{{
 mask = ARRAY[
   [1, 0, 1],
   [0, 1, 0]
   [1, 0, 1]
 ]
 }}}

 An invalid mask...
 {{{
 mask = ARRAY[
   [1, 0],
   [0, 1],
   [1, 0]
 ]
 }}}

 In the default case where weight = FALSE, the above valid mask of zeros
 and ones indicate which pixel values should be passed to the callback
 function. The values zero or NULL are treated as FALSE.

 If weight = TRUE, the values in mask are the weight by which the
 corresponding pixel values are multiplied. If a weight is NULL, the pixel
 value is set to NULL.

 The basic function should look like...

 {{{
 ST_MapAlgebra(
   rastbandargset rastbandarg[],
   callbackfunc regprocedure,
   pixeltype text=NULL,
   extenttype text=INTERSECTION, customextent raster=NULL,
   mask double precision[][]=NULL, weighted boolean=FALSE,
   VARIADIC userargs text[]=NULL
 );
 }}}

 If mask = NULL (or empty array), the center pixel value is passed as-is to
 the callback function.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2341#comment:2>
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-tickets mailing list