I have read Creating random points in QGIS with values from Attribute Table, but it doesn't address my question because I use the same process:
Vector> Research Tools> Random points inside polygons (variable)
I am presented with the following console:
The attribute NUMFARMS is in the attribute table, is integer-valued, and contains 0s for most of the features. Some of the features have a value higher than 1.
The randomly generated points, however, are only ever one per polygon. What am I doing wrong?
EDIT: In response to a comment, here is a screenshot of the Fields tab:
-
You are definitely did not use 'Random points inside polygons (fixed) when you only got one per polygon, as this is what this will do? I know I can see your screenshot is '(variable') but I have replicated everything that I can see above and it is working as it should for me. I am using QGIS 2.18.12.Martin Hügi– Martin Hügi2017年09月19日 21:47:07 +00:00Commented Sep 19, 2017 at 21:47
-
Can you screenshot your layer properties > Fields tabMartin Hügi– Martin Hügi2017年09月19日 21:48:07 +00:00Commented Sep 19, 2017 at 21:48
-
@MartinHügi please see the edit above. I am using 'Random points inside polygons (variable)', not fixed, as I want a different number of points ('NUMFARMS') in each polygon. For example, in the first polygon, there are 12 farms, so there should be 12 points at random locations within the polygon. I am using QGIS 2.18.9 for Mac (Mac OS X Sierra 10.12.16)StatsSorceress– StatsSorceress2017年09月20日 15:09:16 +00:00Commented Sep 20, 2017 at 15:09
1 Answer 1
I am a complete novice with GIS, so I failed to notice the obvious.
The Coordinate Reference System (CRS) gave distances in degrees (I had EPSG 4269, which was the default). I wanted to work with metres.
When I entered a minimum distance of 500.0 apart from one another, that was impossible, so QGIS assigned only one point per polygon. When I removed this restriction, it still only put one point per polygon, so I think this was not the only problem.
I had to change my CRS to one that works with metres. I chose UTM, and found the appropriate zone (since I'm in Canada, I used this website). Then:
1) Right click on the layer
2) Click 'Save As'
3) Next to the CRS field, click 'Select CRS' (which is a small icon)
4) In the 'Filter' field, type the CRS you want (in my case, when I Googled 'UTM zone 14', I got EPSG 32614, and that's what I entered in 'Filter').
5) Click the result to make sure it's highlighted, then click 'OK'.
Note this might give you a save error. To get around this:
Next to 'File name', click Browse.
Navigate to a directory in which you would like to save your file. Click it. This enters the entire path into the 'File name' section.
Rename 'Untitled' to something meaningful, and save.