QGIS – Find the Maximum Value for a Point Among Several Overlapping Vector Layers in QGIS3

geopandaspyqgisqgisqgis-3spatial-join

Dataset 1: around 80 vectorlayers with polygons. Each polygon has a value for a noise measurement. Some of the layers (up to ten at at time) are intersecting at some locations.

Dataset 2: a vectorlayer with sever hundred points.

The goal:
I want to add a column to the point dataset with the maximum value at this place from any of the polygons from the first dataset, as in: "look at the point in question, then look if any of the other layers have a polygon there. Then look at all the values from the noise column of all these polygons and write the highest one into a new column in the attribute set of the point layer".

The problem:
If I just merge the noise-layers I later can't use join_attributes_by_location with the point layer as I get a fix geometry error (I guess because the features are overlapping).
Do I have to split all the features which overlap with a feature in a different layer by all the features with which they overlap and then merge all layers and then merge all features with the same extent preserving only the maximum noise value for each shape, and then use that layer for join_attributes_by_location?
This sounds really complex and also as if it will take forever.

How can I achieve the situation described above (under goal)? Is there another spatial join I can use?

Note 1: I use QGIS 3 and know some Python and very basic R.
Note 2: I don't want to find the maximum value in a column in one attribute table, just to clarify.

Note 2: I'm new to SE, this is my first question. I already searched for similar problems but couldn't find anything. Forgive me if I overlooked something or forgot some piece of information.

Best Answer

You could use Point Sampling Tool plugin.

Note) If you run Point Sampling Tool plugin on a polygon layer which has overlaps, the tool take the attribute value only from the top feature found at the location.

(1) Merge all polygon layers (which produces a polygon layer with a lot of overlapping polygons).

(2) Run Order by expression tool (Processing Toolbox > Vector general)

enter image description here

Select your noise value field as the expression and tick Sort ascending checkbox, so that the polygon with maximum noise comes on top.

(3) Use Point sampling tool to take the noise value from the newly created Ordered layer.

enter image description here

(4) Open the attribute table of the output from the Point sampling tool.

enter image description here

(... my second sampling point missed all polygons, unfortunately).