I wish to add a buffer into project that will update the buffer fields when new points/ polygons are added into the project
If you want a dynamic buffer layer that updates when new records are added, moved, or deleted, or the buffer value in the source data changes...
See the link in the comment to your post for postgis/rdbms solutions, which will be the best long-term solution.
For a foolproof, simple visualisation, try the geometry generator.
- Go to Layer Styling panel -> select style -> Symbol layer type: Geometry generator
- select Geometry type: Polygon/Multipolygon
- enter the following expression
- AMOUNT can be a fixed number in the units of your CRS, or a field in your data - in which case it would be
- buffers will appear as soon as you add or edit a point in qgis, even if you haven't saved edits
To generate polygons that you can calculate areas of and so on, try virtual layers.
- Go to Layer -> Add Layer -> Add/Edit Virtual Layer
- click Import and select your layer
- enter the following query:
SELECT desired_field, desired_field2, 'desired field', st_buffer(geometry,AMOUNT) AS geometry from 'Name of layer';- desired fields are optional. Any names of layers or fields with spaces, or most non-alphanumeric characters, must be wrapped in single quotes. Click Test to check that there are no errors before clicking OK.
- buffers are saved as a separate layer, which will update only when you press Refresh, and any edits are saved (if editing your source layer outside qgis)