[GRASS-dev] Some comments on the v.surf.icw add-on

Benjamin Ducke benjamin.ducke at oxfordarch.co.uk
Mon Jan 4 13:31:21 EST 2010


I have just tested v.surf.icw in some detail.
In general, it is a very nice module that produces
far more realistic results than plain euclidean v.surf.idw
in the right circumstances.

I made some observations and have some questions/comments I'd
like to share:

Line 150:
This produces an error message from the shell if any of the 
env vars does not exist (cosmetics, really):

  if [ $GIS_FLAG_V -eq 1 ] || [ "$GRASS_VERBOSE" -gt 1 ] ; then

Line 234:

  r.cost $VERBOSE -k in=tmp_icw_area_$$ out=cost_site.$NUM coordinate=$EASTING,$NORTHING
  =
  r.cost $VERBOSE -k in=tmp_icw_area_$$ output=cost_site.$NUM coordinate=$EASTING,$NORTHING

Otherwise, it won't play any longer with newer versions of r.cost 
that have the "outdir=" option.

Line 239:

This changes the original input data without any warning or 
documentation about it:

  # so the divisor exists and the weighting is huge at the exact sample spots
  # more efficient to reclass to 1?
  r.mapcalc "cost_site.$NUM = if(cost_site.$NUM == 0, 0.1, cost_site.$NUM)"

Apparently, this is done to avoid a divison by zero in the standard 
IDW formula (line 246):

  EXPRESSION="1.0 / pow(cost_site.$NUM $DIVISOR, $FRICTION )"

If so, it needs to be documented. I actually used costs 
normalized to [0,1] and ran into trouble here. 
I realize now that wasn't a good idea, because a movement 
costof "0" between two spatially distinct locations is physically 
implausible. However, this behaviour still needs to be document, 
perhaps advising users to use a minimum cost of "1"?

Line 246:

The variable $DIVISOR is never initialized (empty) but still 
used in the expression:

  EXPRESSION="1.0 / pow(cost_site.$NUM $DIVISOR, $FRICTION )"


In addition, I would like to know where the second 
IDW formula comes from (-r flag). Any literature
references? When would this be the preferable formula?

Thanks,

Ben


------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.



More information about the grass-dev mailing list