I have a script that creates a square buffer of 1 degree around a point in QGIS, through the python console but I am unable to find a way to create circular buffers instead. Also, would it be possible to add to the script to add multiple buffers around the same point of different distances, as I currently have 1 degree but would like 5 degrees, 10 degrees... etc. The script I have currently written:
layer = iface.activeLayer()
feats = [ feat for feat in layer.getFeatures() ]
epsg = layer.crs().postgisSrid()
uri = "Polygon?crs=epsg:" + str(epsg) + "&field=id:integer&field=x:real&field=y:real&field=point_id:integer""&index=yes"
mem_layer = QgsVectorLayer(uri,
'circular_buffer',
'memory')
prov = mem_layer.dataProvider()
for i, feat in enumerate(feats):
point = feat.geometry().asPoint()
new_feat = QgsFeature()
new_feat.setAttributes([i, point[0], point[1], feat.id()])
tmp_feat = feat.geometry().buffer(1, -1).boundingBox().asWktPolygon()
new_feat.setGeometry(QgsGeometry.fromWkt(tmp_feat))
prov.addFeatures([new_feat])
QgsProject.instance().addMapLayer(mem_layer)