[GRASS-user] Distance layer

Jachym Cepicky jachym.cepicky at centrum.cz
Sun Oct 29 12:24:30 EST 2006


hi,

would it be problem to separate NULL values from your map? e.g.

r.mapcalc yourmap2=if(isnull(yourmap),1,null())

than you can use r.distance

jachym

On Sat, Oct 28, 2006 at 07:11:04PM +0300, Nomad Rain wrote:
> Thank you, Dylan and Jachym
> 
> I tried r.distance (the problem mentioned doesn't prevent)
> 
> Yes  it  gives  me  distances between raster pixels. However I need to
> calculate in cycle all the distances from the only point to every NULL
> pixel in region on new layer.
> 
> And r.distance does not work with null values, do it?
> 
> Help please, because my intuition keeps silence
> 
> ---
> Victor Yeliseyev
> 
> > 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,
> 
> 
> 
> 
> -- 
> С уважением,
>  Nomad                   
> 
> 
> _______________________________________________
> grassuser mailing list
> grassuser at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grassuser

-- 
Jachym Cepicky
e-mail: jachym.cepicky at centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------   
OFFICE:                                     
Department of Geoinformation Technologies 
Zemedelska 3
613 00, Brno
Czech Republick
e-mail: xcepicky at node.mendelu.cz
URL:    http://mapserver.mendelu.cz
Tel.:   +420 545 134 514
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20061029/d6a1060a/attachment.bin


More information about the grass-user mailing list