<div dir="ltr"><div>Yes I think you got it right! <br></div><div><br></div><div>I don't know how to use python very well, so I'd appreciate some code to work off of. No rush though! </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 18, 2021 at 2:00 PM <<a href="mailto:qgis-user@stripfamily.net">qgis-user@stripfamily.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
If I understand correctly, your problem is that the layer you are
buffering has multiple polygons and the buffer around polygon 1
might intersect polygon2, so if you buffer the layer, then
difference the layer from the buffer, you lose these overlaps. What
you want is to difference buffer 1 with polygon 1, buffer 2 with
polygon 2, etc.<br>
<br>
I am not aware of a way to do that from the GUI, but it's only a
couple of line in PyQgis. You need to loop over the features of the
buffer layer, differencing the corresponding polygon from the
original layer. In my quick test, the FID is preserved across the
two layers. The feature order appears to be the same, but it would
be prudent to sort the two lists of features first to be sure of the
same order. Then it's just a matter of looping over the features and
calling the difference method on the two geometries and adding the
result to your new layer.<br>
<br>
If nobody comes up with a better method or code and you don't know
how to write Python, I'll probably have a bit of time later today to
bang this out.<br>
</div>
</blockquote></div>