CC-licensed from flickr users imh and hisgett
CC-licensed from flickr users king-edward and hisgett
##[BSR scripts]=group
##areas=vector
##scale_factor=number 2
##buffered=output vector
from PyQt4.QtCore import *
from qgis.core import *
import processing
from processing.core.VectorWriter import VectorWriter
from bsrutils import rescaleBuffer
areas_layer = processing.getobject(areas)
areas_features = processing.getfeatures(areas_layer)
fields = areas_layer.pendingFields().toList()
writer = VectorWriter(buffered, None, fields, POLYGON, areas_layer.crs() )
for feature in areas_features:
outFeat = rescaleBuffer(feature, scale_factor)
writer.addFeature(outFeat)
##[BSR scripts]=group
##areas=vector
##owner=field areas
##conflicts=output vector
...
for aFeature in features:
for bFeature in features:
if ownerValue(aFeature) != ownerValue(bFeature):
if aFeature.geometry().intersects(bFeature.geometry()):
outFeature.setGeometry(aFeature.geometry().intersection(bFeature.geometry()))
writer.addFeature(outFeature)