I have a polygon layer (where each feature has a class attribute), and a point layer, and there are at least 10 points within each feature of the polygon. Is there a way to randomly select only "k" points of these 10 points for each feature (class) in QGIS?

select only two of ten points that are within each polygon



you could use 'join by location' to add the polygon attributes to the corresponding points. then use 'research tools/random selection within subset' to select the right number/percentage of points from each polygon value.

  • But then do I have to manually do the 'random selection within subset'for each class? because it seems it does it only for one class at a time – Alex Feb 4 '14 at 2:50
  • As far as I can see from the documentation and tool format, it should be generating points for every unique id in the selected field. you should make sure each feature have a unique value, and not use a value shared by multiple polygons. either that, or you have a polygon selected and it is only running on already selected features – TDavis Feb 4 '14 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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