From: Bborie Park Date: Wed, 19 Sep 2012 18:48:31 +0000 (+0000) Subject: Added docs for ST_InvDistWeight4ma() and ST_MinDist4ma(). Changed X-Git-Tag: 2.1.0beta2~635 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4fef47493eaa7a534086c27fa67a2538fb53b0d;p=postgis Added docs for ST_InvDistWeight4ma() and ST_MinDist4ma(). Changed function signature for ST_Neighborhood() to support specifying distances on both X and Y axis. git-svn-id: http://svn.osgeo.org/postgis/trunk@10305 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/html/images/st_invdistweight4ma_equation.png b/doc/html/images/st_invdistweight4ma_equation.png new file mode 100644 index 000000000..750cfd232 Binary files /dev/null and b/doc/html/images/st_invdistweight4ma_equation.png differ diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index f78e9dcb2..e2f2a4012 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -9114,7 +9114,124 @@ WHERE rid = 2; - + + + + ST_InvDistWeight4ma + Raster processing function that interpolates a pixel's value from the pixel's neighborhood. + + + + + + double precision ST_InvDistWeight4ma + double precision[][] matrix + text nodatamode + text[] VARIADIC args + + + + + + Description + + Calculate an interpolated value for a pixel using the Inverse Distance Weighted method. + + + There are two optional parameters that can be passed through args. The first parameter is the power factor (variable k in the equation below) between 0 and 1 used in the Inverse Distance Weighted equation. If not specified, default value is 1. The second parameter is the weight percentage applied only when the value of the pixel of interest is included with the interpolated value from the neighborhood. If not specified and the pixel of interest has a value, that value is returned. + + + + The basic inverse distance weight equation is: + + + + + + + + + k = power factor, a real number between 0 and 1 + + + + + + + + This function is a specialized callback function for use as a callback parameter to . + + + Availability: 2.1.0 + + + + Examples + +-- NEEDS EXAMPLE + + + + + See Also + + , + + + + + + + + ST_MinDist4ma + Raster processing function that returns the minimum distance (in number of pixels) between the pixel of interest and a neighboring pixel with value. + + + + + + double precision ST_MinDist4ma + double precision[][] matrix + text nodatamode + text[] VARIADIC args + + + + + + Description + + Return the shortest distance (in number of pixels) between the pixel of interest and the closest pixel with value in the neighborhood. + + + + The intent of this function is to provide an informative data point that helps infer the usefulness of the pixel of interest's interpolated value from . This function is particularly useful when the neighborhood is sparsely populated. + + + + + This function is a specialized callback function for use as a callback parameter to . + + + Availability: 2.1.0 + + + + Examples + +-- NEEDS EXAMPLE + + + + + See Also + + , + + + + + diff --git a/raster/rt_pg/rtpostgis.sql.in.c b/raster/rt_pg/rtpostgis.sql.in.c index 43b89e0da..065ffeab7 100644 --- a/raster/rt_pg/rtpostgis.sql.in.c +++ b/raster/rt_pg/rtpostgis.sql.in.c @@ -2587,7 +2587,7 @@ CREATE OR REPLACE FUNCTION st_invdistweight4ma(matrix double precision[], nodata -- if args provided, only use the first two args IF args IS NOT NULL AND array_ndims(args) = 1 THEN - -- first arg is exponent + -- first arg is power factor k := args[array_lower(args, 1)]::double precision; IF k IS NULL THEN k := _k;