From 6a224caf22a9fed2f68af83137ca31493ca31823 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Fri, 18 Nov 2011 13:24:40 +0000 Subject: [PATCH] minor corrections git-svn-id: http://svn.osgeo.org/postgis/trunk@8176 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_raster.xml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index b71632666..841e1a161 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -3592,7 +3592,7 @@ WHERE rid = 2; Algorithm options are: 'NearestNeighbor', 'Bilinear', 'Cubic', 'CubicSpline', and 'Lanczos'. Refer to: GDAL Warp resampling methods for more details. NearestNeighbor is the fastest but worst interpoloation. The scalex, scaley define the desired new ratio between geometry units and pixel units. Note: This is different from in that ST_Rescale changes the underlying pixels of the raster using existing scale - and rescales it to the new input scales. , on the otherhand, changes the metadata of the raster to correct a misSpecified scaling. + and rescales it to the new input scales. , on the other hand, changes the metadata of the raster to correct an originally mis-specified scaling. Availability: 2.0.0 Requires GDAL 1.6.1+ @@ -6079,7 +6079,9 @@ SELECT ST_MapAlgebraFct(m1.rast, 1, m1.rast,3 , (one raster version) Return a raster which values are the result of a PLPGSQL user function involving a - neighborhood of values from the input raster band. + neighborhood of values from the input raster band. The user function takes the neighborhood of pixel values + as an array of numbers, returns one number per neighborhood, + replaces existing pixel values of a neighborhood with that number. @@ -6104,7 +6106,8 @@ SELECT ST_MapAlgebraFct(m1.rast, 1, m1.rast,3 , userfunction - PLPGSQL user function to apply to neighborhod pixels. + PLPGSQL/psql user function to apply to neighborhood pixels. The first element is a 2-dimensional + array of numbers representing the rectangular pixel neighborhood args @@ -6127,14 +6130,14 @@ CREATE OR REPLACE FUNCTION rast_avg(matrix float[][], nodatamode text, variadic RETURNS float AS $$ DECLARE - _matrix float[][]; + _matrix float[][]; x1 integer; x2 integer; y1 integer; y2 integer; sum float; BEGIN - _matrix := matrix; + _matrix := matrix; sum := 0; FOR x in array_lower(matrix, 1)..array_upper(matrix, 1) LOOP FOR y in array_lower(matrix, 2)..array_upper(matrix, 2) LOOP @@ -6151,9 +6154,9 @@ CREATE OR REPLACE FUNCTION rast_avg(matrix float[][], nodatamode text, variadic RETURN (sum*1.0/(array_upper(matrix,1)*array_upper(matrix,2) ))::integer ; END; $$ - LANGUAGE 'plpgsql' IMMUTABLE COST 1000; +LANGUAGE 'plpgsql' IMMUTABLE COST 1000; --- now we apply to our rescaled katrina averaging pixels within 2 pixels of each other -- +-- now we apply to our raster averaging pixels within 2 pixels of each other in x and y direction -- SELECT ST_MapAlgebraFctNgb(rast, 1, '8BUI', 2, 2, 'rast_avg(float[][], text, text[])'::regprocedure, 'NULL', NULL) As neared FROM katrinas_rescaled limit 1; -- 2.40.0