[postgis-tickets] [PostGIS] #2629: [raster] Masks as POI lists

PostGIS trac at osgeo.org
Fri Jan 31 23:09:23 PST 2014


#2629: [raster] Masks as POI lists
-------------------------+--------------------------------------------------
 Reporter:  nclay        |       Owner:  dustymugs     
     Type:  enhancement  |      Status:  new           
 Priority:  medium       |   Milestone:  PostGIS Future
Component:  raster       |     Version:  trunk         
 Keywords:               |  
-------------------------+--------------------------------------------------
 Mask internally to MapAlgebra should not be represented by 2D arrays as
 that leads to  an iteration over every element. When in the sparse case of
 a mask it would be much more efficient to set the deterministic values
 then iterate over the non-deterministic values and setting their
 appropriate return value. Thus minimizing the number of iterations
 MapAlgebra does for each mask operation.

 {{{
  mask = [
  3.14,0,0,0,3.14
   0,0,0,0,0
  3.14,0,0,0,3.14
  ]
  poi = [3,2]


  poiList = [ [0,0,3.l4],[0,4,3.14],[2,0,3.14],[2,4,3.14]]
  eg.
  poilist = [[x,y,mValue],...,[poix,poiy,1]]
  }}}

 However, we must be careful not to detrimentally affect the execution of
 dense masks. The code implementing this should take into account the
 sparseness of an mask and take appropriate action.

 eg. With a dense mask it would be best not to preset any of the values in
 the returning array as this would just waist execution time. However with
 a sparse mask the opposite is true. There for a separate utility function
 should be created to encapsulate the logic of determining how best to
 represent the mask as a poi list and the presetting of deterministic
 values.

 {{{
 rt_util_mask_to_poi(  .... )
 }}}

 Also it may be beneficial to a user to have the ability to hint MapAlgebra
 that a mask is sparse through a optional hint in the Mask Object.
 {{{
 sparse = BOOLEAN
 }}}

 When NULL a best effort determination is made by:
 {{{
 rt_util_mask_to_poi( ... )
 }}}

 Also, this will require a new rt_pixel function as well as a new rt_mask
 representation:
 {{{
 rt_pixel_set_poi_to_array( ... )
 }}}

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