[Qgis-user] using difference on buffers

Chan Dolan chandler.dolan51 at gmail.com
Tue Jan 19 08:49:57 PST 2021

thank you thank you!

Ill try it out and report how it goes.

On Mon, Jan 18, 2021 at 9:56 PM <qgis-user at stripfamily.net> wrote:

> Here's a script to buffer each feature, difference the original from the
> buffered, and leave the difference in a new layer.
> The script operates on the active layer and assumes it is a polygon layer.
> The results will be unpredictable if it's not.
> At the top of the script are two parameters, buf_dist and buf_segments.
> These have the same meaning as the buffer operation in geoprocessing.
> Remember that the buf_dist is in the units of the CRS. My test data was in
> meters, so the buf_dist = 10000 is 10 kilometers.
> All the attributes are copied to the new layer, which is called
> buffer_diff. Attributes that are based on the geometry are NOT
> recalculated, so areas or perimeters will be wrong.
> If you run this from the python console, as each feature is processed
> you'll get the message "Adding feature". After the last feature is added
> there may be a noticeable pause before the canvas is repainted.
> I've only tried this on a couple of layer files and they were both in the
> same CRS, so let me know if this fails for your data and I'll see what I
> can do.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210119/5b57982c/attachment.html>

More information about the Qgis-user mailing list