Changes between Version 142 and Version 143 of WKTRaster/SpecificationWorking03

Show
Ignore:
Timestamp:
07/11/11 13:48:15 (23 months ago)
Comment:

--

Unmodified
Removed
Modified
• WKTRaster/SpecificationWorking03

v142 v143
339339 * Here are some commonly used predefined expressions and how they materialize as the four (4) "p_", "t_" and "f_" expressions passed to ST_Mapalgebra(rast1, rast2):
340340
341    - LAST: 'rast2', 'rast2', 'rast1', NULL
342
343    - FIRST: 'rast1', 'rast2', 'rast1', NULL
344
345    - MIN: 'LEAST(rast1, rast2)', 'rast2', 'rast1', NULL
346
347    - MAX: 'GREATEST(rast1, rast2)', 'rast2', 'rast1', NULL
348
349    - COUNT: 'rast1 + 1', '1', 'rast1', '0'
350
351    - SUM: 'rast1 + rast2', 'rast2', 'rast1', NULL
341  - LAST: 'rast2', 'rast2', 'rast1', NULL
342
343  -FIRST: 'rast1', 'rast2', 'rast1', NULL
344
345  -MIN: 'LEAST(rast1, rast2)', 'rast2', 'rast1', NULL
346
347  -MAX: 'GREATEST(rast1, rast2)', 'rast2', 'rast1', NULL
348
349  -COUNT: 'rast1 + 1', '1', 'rast1', '0'
350
351  -SUM: 'rast1 + rast2', 'rast2', 'rast1', NULL
352352
353    - RANGE:
354     - p_expressions = 'LEAST(rast1, rast2)', 'rast2', 'rast1', NULL
355     - t_expressions = 'GREATEST(rast1, rast2)', 'rast2', 'rast1', NULL
356     - f_expressions = 'rast1 - rast2', NULL, NULL, NULL
353  -RANGE:[[BR]]
354    -p_expressions = 'LEAST(rast1, rast2)', 'rast2', 'rast1', NULL[[BR]]
355    -t_expressions = 'GREATEST(rast1, rast2)', 'rast2', 'rast1', NULL[[BR]]
356    -f_expressions = 'rast1 - rast2', NULL, NULL, NULL
357357
358    - MEAN:
359     - p_expressions = 'rast1 + rast2', 'rast2', 'rast1', NULL  //sum
360     - t_expressions = 'rast1 + 1', '1', 'rast1', '0'   //count
361     - f_expressions = 'CASE WHEN rast2 > 0 THEN rast1 / rast2::float8 ELSE NULL END', NULL, NULL, NULL  //sum/count
358  -MEAN:[[BR]]
359   -p_expressions = 'rast1 + rast2', 'rast2', 'rast1', NULL  //sum[[BR]]
360   -t_expressions = 'rast1 + 1', '1', 'rast1', '0'   //count[[BR]]
361   -f_expressions = 'CASE WHEN rast2 > 0 THEN rast1 / rast2::float8 ELSE NULL END', NULL, NULL, NULL  //sum/count
362362
363    - STANDARD_DEVIATION: NOT POSSIBLE, nead two passes. See how ST_SummaryStats() does it...
363  -STANDARD_DEVIATION: NOT POSSIBLE, nead two passes. See how ST_SummaryStats() does it...
364364
365    - MAX_LENGTH, MAX_AREA or MAX_ANYTHING (require MapAlgebra being able to reference other bans than 1):
366     - p_expressions = 'CASE WHEN rast1[2] > rast2[t] THEN rast1[1] ELSE rast2[1] END', 'rast2[1]', 'rast1[1]', NULL
367     - t_expressions = 'CASE WHEN rast1[2] > rast2[2] THEN rast1[2] ELSE rast2[2] END', 'rast2[2]', 'rast1[2]', NULL
368     - f_expressions = 'rast1', NULL, NULL, NULL
369
365  -MAX_LENGTH, MAX_AREA or MAX_ANYTHING (require MapAlgebra being able to reference other bans than 1):[[BR]]
366   -p_expressions = 'CASE WHEN rast1[2] > rast2[t] THEN rast1[1] ELSE rast2[1] END', 'rast2[1]', 'rast1[1]', NULL[[BR]]
367   -t_expressions = 'CASE WHEN rast1[2] > rast2[2] THEN rast1[2] ELSE rast2[2] END', 'rast2[2]', 'rast1[2]', NULL[[BR]]
368   -f_expressions = 'rast1', NULL, NULL, NULL
370369
371370 * A PL/pgSQL prototype of ST_Union exist in script/plpgsql/st_union.sql.