I am using QGIS (ver2.18.22) to join 2 layers (polygons) at intersections to derive some summary statistics into the join layer ("Grid" layer). The "Grid" layer is assembled by using Create Grid, and the "Merged" layer is assembled by Merge vector layers tool using 8 different layers that all have the same polygons and attributes, just different values for the attributes.
In PyQGIS I do the joining part by the following:
processing.runalg("qgis:joinattributesbylocation", "Grid", "Merged", u'intersects', 0, 1, "mean,min,max,median,q1,q3", 1, OUTPUT_PATH)
(I have also done this using the QGIS GUI) I am getting incorrect values for the Q1 and Q3 (Quartiles) statistics. For example, Q1 = Q3, furthermore, Q1 > median. It seems QGIS 3 does this correctly though. My question is 2 parts:
Is there a plugin for QGIS 2.18 that corrects this behavior in the core Join Attributes By Location tool for getting quartiles?
What would be the equivalent PyQGIS code for QGIS 3? The api for 2 and 3 are totally different. For example, processing.runalg, processing.alglist are not found in QGIS3.