[Qgis-user] Not so Random Points in Polygon generation

Richard Duivenvoorde rdmailings at duif.net
Thu Feb 19 11:32:26 PST 2015


On 19-02-15 19:54, Chris Berens wrote:
> Hi all,
> 
> The random points I generate inside polygons with QGIS always seem to
> follow lines.  This is also evident on the Linfiniti manual example of
> same:
> http://manual.linfiniti.com/en/vector_analysis/spatial_statistics.html
> Is there a reason for this?

Hi Chris,

I do not see 'lines', but I do see some 'flocking'...
It all depends on the algorithm used:

https://github.com/qgis/QGIS/blob/master/python/plugins/fTools/tools/doRandPoints.py#L154-L170

not sure if you can deduct what is the 'problem' there.

For a plugin I created for a client: Feature Grid Plugin (to create a
regular grid of points in a polygon for small work plots), I had a look
into some algorithms to create a given number of points in a polygon
which are random but also fill up the space at best. The best algorithm
to use (and is very nice to look at) comes from
http://bost.ocks.org/mike/algorithms/  <== look at those !!!
and is called 'Poisson-disc:
http://www.jasondavies.com/poisson-disc/

If people are interested I think it is nice to either add this to ftools
or to my own plugin.

Regards,

Richard



More information about the Qgis-user mailing list