I have a buffer layer (green polygon) which I want to split to two polygons whenever it crosses a barrier (blue line). I have been trying to use "splitGeometry" method, but I just can't get it to work. My code so far is this :
while ldbuffprovider.nextFeature(feat): while barprovider.nextFeature(feat2): if feat.geometry().intersects(feat2.geometry()): intersection = feat.geometry().intersection(feat2.geometry()) result, newGeometries, topoTestPoints=feat.geometry().splitGeometry(intersection.asPolyline(),True)
Which returns 1 for result( error) and an empty list for newGeometries. Any help is greatly appreciated.