Forgot to post my solution...
STEP 1 : Merge layers
In the end I changed my Qgis Version
to 2.14.11, the algorithm takes a single input param (layers) separated by a semicolon :
processing.alghelp('qgis:mergevectorlayers')
ALGORITHM: Merge vector layers
LAYERS <ParameterMultipleInput>
OUTPUT <OutputVector>
Prior it was :
processing.runalg('qgis:mergevectorlayers', layer1, layer2, output)
You can also do a loop to use this version of the algorithm
for i, layer in enumerate(layers):
if i == 0:
layer1 = layers[i]
layer2 = slayers[i+1]
processing.runalg('qgis:mergevectorlayers', layer1, layer2, savename)
if i == leng-1:
break
else:
layer1 = QgsVectorLayer(savename, 'temp', 'ogr')
layer2 = sme_layers[i+1]
savename = name
processing.runalg('qgis:mergevectorlayers', layer1, layer2, savename)
STEP2 : overlay the layer with itself
processing.alghelp('grass:v.overlay')
ALGORITHM: v.overlay - Overlays two vector maps.
ainput <ParameterVector>
atype <ParameterSelection>
binput <ParameterVector>
operator <ParameterSelection>
-t <ParameterBoolean>
GRASS_REGION_PARAMETER <ParameterExtent>
GRASS_SNAP_TOLERANCE_PARAMETER <ParameterNumber>
GRASS_MIN_AREA_PARAMETER <ParameterNumber>
GRASS_OUTPUT_TYPE_PARAMETER <ParameterSelection>
output <OutputVector>
STEP 3
Joseph answer seems decent
Singleparts to multipartstool on the merged layer. Then use SAGA'sIntersect tool and check the Split parts option. Hopefully, the black area should be a separate feature in the output layer. You can then save the black area feature in a new layer then run theJoin attributes by locationtool using the new black area layer and the merged layer as inputs to get the count field. – Joseph Jun 16 '17 at 11:37