[GRASS-user] Distance layer

Dylan Beaudette dylan.beaudette at gmail.com
Fri Oct 27 15:00:36 EDT 2006


On Friday 27 October 2006 11:12, Jachym Cepicky wrote:
> hallo,
>
> On Fri, Oct 27, 2006 at 11:21:16AM -0700, Dylan Beaudette wrote:
> > On Friday 27 October 2006 10:24, Jachym Cepicky wrote:
> > > nobody tested, so i did not commit to cvs. should I commit the patch?
> > >
> > > jachym
> >
> > Hi Jachym:
> >
> > I will update my local grass-cvs source, and if you send me the patch
> > (and how to apply it... i forgot...) I will test it out.
> >
> > Cheers,
>
> patch attached
>
> patch -d raster/r.distance < r.distance.patch
>
> should work
>
> also it would be good, if somebody would say, if the concept is all
> right: both rasters are read twice, before the calculation starts, if
> overlapping shall be checked: 1 for finding boundary pixels and 2 for
> finding overlapping pixels. when I looked at the code, I could not code
> something better.
>
> thanks for testing.
>
> jachym

Thanks Jachym. 

I can confirm your findings, posted on the dev list, with the spearfish60 
data:

# from Markus' post:
#Spearfish example:
g.region -dp

# extract field #25:
r.mapcalc "myarea=if(fields == 25, 1,null())"

# this archsite falls into field 25:
v.extract archsites out=mypixel list=9
v.to.rast mypixel out=mypixel use=val val=1

### # using new overlapping check
GRASS 6.3.cvs (spearfish60):~ > r.distance -o --quiet mypixel,myarea fs="   "
1   1   0   601005   4926315   601005   4926315

### # without overlap check
GRASS 6.3.cvs (spearfish60):~ > r.distance  --quiet mypixel,myarea fs="   "
1   1   90   601005   4926315   601095   4926315

# digitized a new area within 'myarea' using r.digit out=testing.area
# same results as above with the patched r.distance
GRASS 6.3.cvs (spearfish60):~ > r.distance -o --quiet testing.area,myarea 
fs="   "
1   1   0   600765   4926555   600765   4926555

(See attached screenshot, myarea is in pink, mypixel is blue, testing.area is 
in green)

looks good to me! :) Thanks!

This was with a fresh (10 minutes ago) update of grass6 CVS branch, with your 
recently posted patch. Note that the patch on the dev list from a while back 
did not compile.


+1 on a commit to CVS.

Cheers,

-- 
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r.distance_patch_image.png
Type: image/png
Size: 2503 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20061027/4697c5e2/r.distance_patch_image.png


More information about the grass-user mailing list