Two geometries can be clipped in various ways. I have expected the same result, but I got two different results. The following method I used.
I have selected the clip function and added two layers. The green feature is the correct result. The geometry has been clipped by the blue layer. Then I get the following result:
All processing commands are available from the QGIS built-in Python console. I used the function 'qgis: clip'.
processing.runandload('qgis:clip', layer1, layer2, None)
Then I get the following incorrect result:
It seems to me as if the blue layer is empty or is ignored.
What am I doing wrong?
Update:
The Feature (orange frame, layer1) should be cut at the blue layer (layer2).
What I do not understand is why the clip function of QGIS works. To find under: Vector -> Geoprocessing Tools -> Clip.
When I run the following code, I get an incorrect result:
processing.runandload('qgis:clip', layer1, layer2, None)
Even if I reverse the two layers, I get the same result:
Why I do not get the same result? Take the tools not the same clip function?
layer1
andlayer2
come from? Is there any output in the message log, processing tab? Or in the processing history?layer1
andlayer2
(e.g.processing.runandload('qgis:clip', layer2, layer1, None)
?