Changes between Version 34 and Version 35 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
Mar 14, 2011, 11:15:03 AM (13 years ago)
Author:
pracine
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v34 v35  
    197197
    198198----
    199 == '''Objective FV.03 - Being able to use "group by" to accumulate tiles to form a new raster.''' ==
     199== '''Objective FV.03 - Being able to use neighbour pixels in MapAlgebra expressions.''' ==
     200
     201For now ST_MapAlgebra expressions refer only to the pixel being computed. e.g. "rast * 100". The original plan was to allow refering to neighbour pixels using two coordinated relative to the pixel being computed. e.g. "rast[-1,0] * 100" where rast[-1,0] refer to the value of the pixel one pixel to the left of the pixel being computed. However this syntax might prove to be hard to use when many neighbours are to be used.
     202
     203An alternative syntax would involve another function name (e.g. ST_MapAlgebraNgb) and a way to define a neighbour rectangular region around the computed pixel (e.g.: "2,2" meaning a rectangle encompassing the two neighbour pixels in each direction) and a function to call with this matrix of pixel values. A complete example might look like:
     204
     205SELECT ST_MapAlgebraNgb(rast, "ST_Avg", 2, 2, "ignore")
     206
     207So this would mean "for each pixel, compute the average of all the 1 + 8 + 16 = 25 pixels surrounding the current pixel and "ignore" pixels with nodata values."
     208
     209The "ST_Avg" summarizing function should accept three parameters: an array of float8 values, a X and a Y dimension, and optionnally a "what to do with nodata values". The possible value for this parameter could be:
     210
     211 *"NULL": If any value is a nodata value, return NULL.
     212 *"ignore": Ignore any nodata value so that if 4 pixels on 25 are nodata values, do the computation with the 21 remaining.
     213 *a value: Replace any nodata value with this value and compute.
     214
     215Users could write their own map algebra summarizing functions.
     216
     217A more sophisticated version would pass a georeferenced raster instead of just a value matrix so that summarizing function could use this geoereference (e.g. to determine a ).
     218
     219Any remaining parameters to ST_MapAlgebraNgb could be passed to the summarizing functions for its own need.
     220
     221
     222----
     223== '''Objective FV.04 - Being able to use "group by" to accumulate tiles to form a new raster.''' ==
    200224 
    201225