Changes between Version 4 and Version 5 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
Feb 20, 2010, 8:13:53 AM (14 years ago)
Author:
dzwarg
Comment:

Fleshed out ST_MapAlgebra specs

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v4 v5  
    3838'''ST_Area(raster|geometry) -> double'''[[BR]]
    3939'''ST_Count(raster, value) -> integer'''[[BR]]
    40 '''ST_Resample(raster, pixelsize, method) -> raster'''[[BR]]
     40
     41'''ST_Resample(raster, pixelsize, method) -> raster'''
     42
     43Recompute a raster in order to change its pixel size and/or the position of its upper left corner.
     44
     45
    4146'''ST_SelectByValue(raster|geometry, ‘expression’) -> same type as first argument'''[[BR]]
    4247'''ST_Reclass(raster|geometry,string) -> same type as first argument'''[[BR]]
    43 '''ST_MapAlgebra(raster|geometry, [raster|geometry,…], ‘mathematical expression’, ‘raster’ |’geometry’) -> raster/geometry'''[[BR]]
     48
     49'''ST_MapAlgebra(raster|geometry, [raster|geometry,…] ‘mathematical expression’, ‘raster’ |’geometry’) -> raster/geometry'''
     50
     51 Variant 1: ST_MapAlgebra(raster|geometry, [raster|geometry,…] ‘mathematical expression’, ‘raster’ |’geometry’, originx, originy, pixelsizex, pixelsizey, rotation ) -> raster/geometry
     52
     53 Variant 2: ST_MapAlgebra(raster|geometry, [raster|geometry,…] 'mathematical expression', 'raster' |'geometry', integer) ->raster/geometry
     54
     55 Variant 3: ST_MapAlgebra(raster|geometry, [raster|geometry,…] 'mathematical expression', 'raster' |'geometry', raster) ->raster/geometry
     56
     57 The first raster passed to ST_MapAlgebra is the 'master' raster, unless either:
     58  1 additional parameter specifies the index (in the parameter list) of the 'master' raster.[[BR]]
     59  1 additional parameter specifies a raster whose origin and cell size should be used to compute the output raster.[[BR]]
     60  4 additional parameters are passed specifying the origin, cell size, and raster rotation.
     61
     62 This function implicitly calls ST_Intersects(raster|geometry, [raster|geometry,…]) to detect if the rasters are overlapping before performing any computation. Additionally, the resulting raster will have the same extent as the result of ST_Intersection(raster, integer, geometry).
     63
     64 One of the implications of the ST_Intersects inclusion is that:
     65  SELECT ST_MapAlgebra(rast1, rast2, mathExpr) FROM mytable WHERE ST_Intersects(rast1, rast2)
     66 will be faster than:
     67  SELECT ST_MapAlgebra(rast1, rast2, mathExpr) FROM mytable
     68
     69 '''Open Question:''' Should ST_MapAlgebra resample rasters internally, or produce a raster that can be processed by ST_Resample? If so, variant 1 and variant 3 can be removed, and all ST_MapAlgebra results can be processed through ST_Resample, like:
     70  ST_Resample(ST_MapAlgebra(raster, [raster,…] 'mathematical expression', integer), originx, originy, pixelsizex, pixelsizey)[[BR]]
     71  ST_Resample(ST_MapAlgebra(raster, [raster,…] 'mathematical expression', integer), rastergrid)
     72
    4473'''ST_Clip(raster|geometry,geometry) -> same type as first argument'''[[BR]]
    4574'''ST_Flip(raster|geometry, ’vertical’|’horizontal’) -> same type as first argument'''