vstup = "vodne_toky_sjtsk" vystup = "D:/PHD/výučba/Python/cvičenia/vrstvy_python/toky_buffer.shp" velkost_buffra = 500 vrstvy = QgsProject.instance().mapLayersByName(vstup) vrstva = vrstvy[0] polia = vrstva.fields() feats = vrstva.getFeatures() zapis = QgsVectorFileWriter(vystup, "UTF-8", polia, QgsWkbTypes.Polygon, vrstva.sourceCrs(), "ESRI shapefile") for feat in feats: geom = feat.geometry() buff = geom.buffer(velkost_buffra, 20) feat.setGeometry(buff) zapis.addFeature(feat) iface.addVectorLayer(vystup, "", "ogr")