From b4fef47493eaa7a534086c27fa67a2538fb53b0d Mon Sep 17 00:00:00 2001 From: Bborie Park Date: Wed, 19 Sep 2012 18:48:31 +0000 Subject: [PATCH] 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 --- .../images/st_invdistweight4ma_equation.png | Bin 0 -> 1733 bytes doc/reference_raster.xml | 119 +++++++++++++++++- raster/rt_pg/rtpostgis.sql.in.c | 2 +- 3 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 doc/html/images/st_invdistweight4ma_equation.png diff --git a/doc/html/images/st_invdistweight4ma_equation.png b/doc/html/images/st_invdistweight4ma_equation.png new file mode 100644 index 0000000000000000000000000000000000000000..750cfd2327f4c3b305e96fd2255ffdc1b8961398 GIT binary patch literal 1733 zcmV;$20HnPP)S=BVYqc{n1c!BaN669%3Bd&*Ey%uY zBm#$oM2LVC$&N9;ItdwP91@{}6$u%!!(MrfR-CZzECM3}`t}yI9JbuEJNEVL_VgpD z>Yl2Z>7L$RS(osVe)V4c`n{@p_3EDzI?_Lau1HS0L!a*sopgtOsXO%Z?ojCtBlDTH zgT@YD=7x<{P|?6F@~yVZ{^t?UOMKxET0y58;5A?P=T^{D0Cs#~zZLWtfE%VzSYcKJ z9V;~)d_D4HTlV|9Hs2a(A7u9zi7g%aIs>iE61#?}(okRKcN{ctr-Wws*DHwJ|Bo2K-& zI;$E=qb1p@S!%y^(A~%(4j_D3bwO#3NT55^hHzSVS~f_aRLxz8u{rlz_<_GursJO zhWl~Jg=65}eSiQxuTh)*!=&U+j&c-3P`0H=ShduL;2b#N?Im3u^cW5-cMd$rUxiVc{Bv}$7JA5omu4ye4pZXk zAKnGHqxbboYoS%@<@Hej{0-prl|83QO-2ObpY-NgGJ#gZ)ZZAqm)0r<8RZ;LpyWQS_%&)s>>K#LulJT@FF zL&~<9^mz*KQQ6ac%R2myZDqL7q|;+4*Q;ZI2bJpY20APM6~uTn$N>f*CaI~UQr$#E zM9!wgu84@(kBEqDS6qHaiaW)&Fa5y8@MgJrbpGnZTo41r&wT04`tWy1#T0sRWJ4!j zG{AgFOx7;xUrW-5rmb3Kl5hV;M1ET}FqKs_mwslfZX}Q|cr;k)`&{~81MMHd#it_x zW=bt?wpP-n>89bq_XyuSYlEoB?uYl@hCUj|=!s;F7)z;v#={I|j(lG=knz->nq>r> zU&`O|h*SXl=yK4&K=bHwFo4kbo$0YJ-(7#dV!LTfzdC)j9arn{5x_gJy!Eap+f4_K zs9{{aF|fI*e*zNmNH-huerdPT_fDYD$)Dn8sGrdT02#%het#?e-HJ?IOD2YkeGSOo zXuc}7pupjF+ruaw?nxTNFAsF&uB#wwVbAMtn@XLV3QJPJ_{bT!@Ykyy2Bg{=8rqO} z^7I44?}I->Dy#NblWQ0H2BYhVJ;L1r_-Lio9e`-+d3+m)ou4Ipj`F;Mz5o<_h)=_6 zpw(FQH{9lglxZ~+DR!JREFzM~IGc_QKTg?*UFDO?>ISI$rbUiTr%40JHeIEE;>gRJ zj*|42azoy2x6{^DG(YStgafWSwG{0)N6b--ZM!0T&wJj~XyX zOH0>~1}X+}_Sg*0;5`x9-gcCe##LQqY}x@ChB#Zx^$zn!$#|2|(BT($Efw$1=@#MdY#MJ@qKx^_1%# zpt2y^S0e~E-?|<|p6W^Cq&vP*aw=Wgkv(a&dPoYpk{AaTl+6xn_v&S_=F5!^kCpo6 zytL5AA2&UFNr1ZOVcR_Ua?jJ=Z*tg}*;gZAIfs9>3EC4`eT4|Lcty&q9u9L~bD4(< z?H9k&Jk>>}A|mgJh#XISO{+&4c}3$N4FHODZ<6QNRb`obKIJdj+|kuJBC# bjJoN6ZW?+fr`=7q00000NkvXXu0mjf_v~82 literal 0 HcmV?d00001 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; -- 2.40.0