3

I have a polygon shapefile with a single object and I want to create random points in it. The tool 'random points in polygon' in QGIS does it job well for polygon 1, but doesn't create any points for polygon 2 with a 'complexer' shape (even though a point layer is created). Somebody knows what could be the problem?

Data: https://drive.google.com/drive/folders/1hc9pHMdckLk_a0YigP-UseVjcNPkMbk3?usp=sharing

Polygon1

Polygon 2

6
  • 2
    Your second polygon has a complex shape, not a complex symmetry. Both polygons are in the same layer? Can you share your data for testing?
    – Babel
    Commented Mar 31, 2022 at 7:29
  • Sure, but I'm relativly new to StackExchange. How can I share data?
    – talocodat
    Commented Mar 31, 2022 at 7:35
  • You can't share here. Upload to a cloud or webspace and share the link here (best edit you initial question and post it there).
    – Babel
    Commented Mar 31, 2022 at 7:36
  • 1
    Have you set a "Global minimum distance between points"? Maybe it cant find a solution
    – Bera
    Commented Mar 31, 2022 at 7:53
  • 1
    I have no problem creating random points in polygons, using your data (problematic shapefile). So you should check your settings and post a screeshot of the dialog window of random points in polygons to see what goes on. Something like this: i.sstatic.net/ztOgd.png
    – Babel
    Commented Mar 31, 2022 at 10:12

1 Answer 1

1

I'm not exactly sure what is causing this issue, but I did find a workaround.

If you use the algorithm with the ID 'qgis:randompointsinsidepolygons' instead of 'native:randompointsinsidepolygons' you shouldn't run into this issue. This method seems to have slightly less control, but for most purposes should work fine.

2
  • 1
    Isn't that the same?
    – Babel
    Commented Mar 31, 2022 at 10:05
  • For me, it showed a different UI for the algorithms, and one worked and one didn't. So I guess not.
    – enor
    Commented Mar 31, 2022 at 11:33

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.