[R-sig-Geo] Selecting n cells more then minDist apart

Rainer M Krug r.m.krug at gmail.com
Wed Jan 25 12:10:32 CET 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I need to select n cells on a raster map with no cell closer then
minDist from any other selected cell. The distances can be larger - no
problem - but they must not be smaller then minDist.

I looked at r.random.cell in GRASS with using distance= as the min
distance, but if I select randomly n cells from the set generated, I
get cells with a multiple of minDist apart - not exactly what I am
looking for.

I could use r.random and iterate until my requirements are met, but
that strikes me as extremely inefficient.

As I would be calling GRASS from R, I could also easily use R directly.

Is there any way of doing this easily in R?

Cheers,

Rainer

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8f4ygACgkQoYgNqgF2ego/JACfb/FL5Cyqjm9/Dju0cyi+XRpj
1TgAn2oojKKE5xHGNSluhfdxnal27bad
=L9s4
-----END PGP SIGNATURE-----



More information about the R-sig-Geo mailing list