I would like to know how to create an X number of random points in each grid cell.

I'm using data from a DEM layer, which contains information about elevation. I used this information to obtain slope and aspect. Then I created a grid (each cell with 1000 units size) with the objective of randomly sampling each cell (with one, two points, doesn't matter) so I could obtain an average value of slope and aspect for each location (location = grid cell).

My current project looks like this

1 Answer 1


If you write Random in the Processing toolbox, you will find that there are many Random Points inside polygon tools exist in QGIS as you can see below:

enter image description here

You can test which one will fit your needs either Random Points inside Polygon (Fixed) or Random Points inside Polygon (Variable).


Using Random Points inside Polygon (Fixed), you need to specify the number of points: 2 as you want. For minimum distance I put 0.001 in this example, but you can put also Zero (0) and it should work.

enter image description here

Here is the result:

enter image description here

  • That seems to be what I want! Just a small question: Minimum distance is a value you give to say that you want points separated by at least that value is that correct? I used 1000 units (same size of each cell) and I got a ridiculous amount of points! Any ideas? Nov 14, 2017 at 11:07
  • Sorry, it was my mistake. You can keep the value of minimum distance as Zero (0), and it should give you correct result. I will update my answer.
    – ahmadhanb
    Nov 14, 2017 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.