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.
-
1A spatial join should be an easy workaround.John– John2020年07月30日 13:41:57 +00:00Commented Jul 30, 2020 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– mbela2020年07月31日 15:27:01 +00:00Commented Jul 31, 2020 at 15:27
1 Answer 1
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.