Alternative solution (QGIS 3.8):
Processing Toolbox> v.clean:
Use the tools "break", "snap", "rmdup", "rmline"
Set the threshold in 0.3,0,0 (replace 3 by the maximum distance for which the snapping must be done)
Processing Toolbox> Regroup
Processing Toolbox> Merge Lines
Processing Toolbox> Cut with lines
For this step, just cut the layer with itself
I would do it in this way:
Assign all polygons a unique building_id
Do a Spatial Join so each polyline is assigned the building_id it's associated with
In the new sj_polyline table, Summarize on the building_id and chose the Z attribute to perform Statistics on with the "Maximum" Statistic Type
Join the new summarize_sj_polyline table to your building ...
Since you tagged pyqgis, here is a python solution which you can run from the python console. A couple of notes on the script. Since you say have around 80 polygon layers, the script below takes all polygon layers in the current project and stores them in a list, so when you run this script you should make sure your project does not contain any polygon ...
You should apply reverse Spatial Join, from point to buffer.
1-Firstly create a field with unique value in buffer polygons (you can use objectID or FID).
2-Than apply spatial join (right click on point layer and choose Join or search it in toolboxes)
3- Summarize the new layer by this field (open attribute table and right click on that field name you ...
I would try this approach:
Merge all the layers into one (without fusing the polygons)
Run the "Union" command to properly split overlapping polygons, while retaining all information.
Create a second layer, let's call it "MaxP", with polygons split at each intersection, and only keeping the maximum value found among the original polygons at that position.
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 ...
So I have currently done this by just making a JOIN on the raster geometry and this seems to work reasonably well (given the size of the rasters). If I am missing something basic and there is a much faster way to do this it would be good to know:
-- this works and seems to get us correct values
WITH solarpot AS (
Here is an example, with 100 polygons and 150 points, using similar syntax of st_join. I'm never getting more than one match when using k=1 (there can be zero matches when the nearest feature is further than maxdist).
If you can please post a reproducible example where you are getting more than one match will be happy to look into it.
I have tried to set up the example above. I hope I correctly noticed that your point layer consists of points located very close to each other. Looks like the output after using the 'Create points along lines' tool.
Tested on QGIS 2.18 and QGIS 3.4
I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer....
Use the extract specific vertices tool to extract the endpoints of each line as a separate point layer, as explained here.
Use the NNJoin plugin to perform a nearest-neighbor join between the new endpoints layer and your other point layer. Or use the geomnearest function from the refFunctions plugin in the Field Calculator.
Use the Field Calculator to ...