[Qgis-user] Stratified sampling based on polygon ID (vs. individual polyons)

Jonathan Greenberg jgrn at illinois.edu
Sat Sep 7 12:58:50 PDT 2013


Robert:

Thanks!  Yeah, I ended up being a bit more patient (after your
response) and realized it WAS working, it just took a REALLY long
time.  I found this bug report from 2 years ago:

http://hub.qgis.org/issues/3371 (Random points is terribly slow with
complex features)

which seems to still be unresolved.  I'll check out the internal code
at some point, but I'm not a QGIS developer -- is there anyone out
there that might like to "collaborate" on speeding this up (if I come
up with some algorithm modifications, could someone actually implement
them?)

By the way: this is a non-trivial issue, in my opinion, if someone
wants to do "true" stratified sampling (per-polygon sampling isn't
really stratified in most cases), this tool, applied to a multi-part
polygon, is the only tool I've found that can do this (ArcGIS and
plugins don't seem to work).

--j


On Fri, Sep 6, 2013 at 6:32 AM, Robert Nuske <rnuske at gwdg.de> wrote:
> Hi Jonathan,
>
> the process you described works for me in QGIS 1.8.
>
> After fiddling with your dataset I  reverted to a minimal example of a dozen
> polygons and three groups. After converting the singleparts to multiparts I
> asked for 5 "random points" in "stratified sampling design".  Each multipart
> feature got 5 points and in every multipart the points where spread out across
> all polygons belonging to that multipart.
>
> So I guess its a matter of size.
>
> cheers
>   robert
>
>
> Am Donnerstag, 5. September 2013, 16:09:53 schrieb Jonathan Greenberg:
>> QGISers:
>>
>> I'm trying to realize stratified random sampling using a
>> classification raster that I polygonized.  It seems like the random
>> points tool will create random points within each polygon, but in my
>> case the strata are the classes, which can be scattered across a
>> landscape -- in other words, multiple polygons make up a single strata
>> (I'd argue this is a more valid definition of stratified random
>> sampling).  I'd like to choose, say, 10 random points falling in each
>> group of polygons with a given shared (classification) attribute.  Is
>> there any way to realize this in QGIS?  I tried pre-converting the
>> polygonized classification file to a multi-part polygon, but the
>> random sampling tool froze up when I used this as an input.
>>
>> I dropped the polygon layer (derived from the classification raster) in:
>> https://drive.google.com/folderview?id=0B8Kij67bij_AMmNPakJmT1p4OWc&usp=shar
>> ing
>>
>> The "DN" attribute is the strata I want to use (notice multiple
>> polygons have the same DN).
>>
>> To be clear: I don't want 10 points per polygon, I want 10 points per "DN".
>>
>> Thanks!
>>
>> --jonathan
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user



-- 
Jonathan A. Greenberg, PhD
Assistant Professor
Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
Department of Geography and Geographic Information Science
University of Illinois at Urbana-Champaign
607 South Mathews Avenue, MC 150
Urbana, IL 61801
Phone: 217-300-1924
http://www.geog.illinois.edu/~jgrn/
AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007



More information about the Qgis-user mailing list