[GRASS-dev] v.perturb

Alessandro Samuel Rosa alessandrosamuel at yahoo.com.br
Thu Aug 28 07:02:06 PDT 2014


I will follow your suggestion as far such functionality is not implemented in v.perturb.

 
Alessandro Samuel-Rosa 
--- 
Graduate School in Agronomy - Soil Science 
Federal Rural University of Rio de Janeiro 
Seropédica, Rio de Janeiro, Brazil 
--- 
Guest Researcher at ISRIC - World Soil Information 
Wageningen, the Netherlands 
--- 
Homepage: soil-scientist.net   Skype: alessandrosamuel


Em Quinta-feira, 28 de Agosto de 2014 15:09, Moritz Lennert <mlennert at club.worldonline.be> escreveu:
 


On 28/08/14 14:55, Alessandro Samuel Rosa wrote:
> My objective is to perform a spatial simulated annealing schedule. It
> works as follows:
>
> 1) generate a set of n points randomly positioned in the study area
> (v.random);
> 2) query values from raster maps (r.what);
> 3) calculate an statistic;
> 4) randomly perturb one randomly selected point;
>     - the point has to fall withing the study area;
> 5) go through 2-4 till the statistic meets a given criterion.
>
> Ideally, v.perturb would do step 4: allow for perturbing a single point
> and check if it still falls inside the study area. If the point falls
> outside the study area, then it should be forced to the closest position
> within the study area.

Until someone adds this functionality to v.perturb, you could just use a 
loop like this:

- v.extract your point (possibly v.extract -r the other points)
- perturb extracted point
- while point outside region (you can check either mathematically using 
the points coordinates that you can get via v.to.db or you can use 
v.select the point with the region polygon and check whether the result 
is empty or no)
    - perturb the point again


Moritz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140828/be2be832/attachment.html>


More information about the grass-dev mailing list