[GRASS-user] Selecting n cells more then minDist apart

-----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 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. Are thare any other ways of
achieving this?

As I am doing the calculations from R, I could also easily use R directly.

Any pointers are welcome,

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@krugs.de

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

iEYEARECAAYFAk8f4yQACgkQoYgNqgF2egrvMwCdEhDN8LR/Eu/wXrsqxcWdJNsE
BtIAnjgOvI/eBMKW74NEWkrWYYgDoEJJ
=MQFz
-----END PGP SIGNATURE-----

Rainer wrote:

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 -

out to infinity?

but they must not be smaller then minDist.

I looked at r.random.cell 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. Are thare any other ways of
achieving this?

you might try to prepare a legal-zone mask with
v.buffer + v.overlay, then try e.g. the
v.random.cover addon module:

http://grass.osgeo.org/wiki/GRASS_AddOns#v.random.cover

"Randomly generate a 2D points map constrained to an area"

See also 'r.random cover= vector_output='"

(no escape from "iterate until my requirements are met", but it's as efficient as it can be)

Hamish