4

How do I retain polygon feature attributes in random points generated within these polygons using QGIS?

Like Generating random points inside polygons that capture values from multiple attribute fields, I found that QGIS 3.14 "Random Points inside Polygons" tool does not retain any attributes from the polygon features.

2
  • 1
    A spatial join should be an easy workaround.
    – johns
    Jul 30 '20 at 13:41
  • It would work in some cases but it would not work if there are overlapping bounding geometries used to generate the random points.
    – mbela
    Jul 31 '20 at 15:27
2

For built-in solution, you need to wait for QGIS 3.16 because of this PR https://github.com/qgis/QGIS/pull/35745 (C++ implementation)

I've already made an addition to existing Python processing script as mentioned in QGIS Random Points in Polygon PRESERVING Attribute Table? for this intent (PS: stop using it when QGIS 3.16 will land). Only useful to avoid waiting.

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.