I wish to add a buffer into project that will update the buffer fields when new points/ polygons are added into the project

  • 1
    In what way do you want them to change? – pLumo Aug 25 '17 at 14:07

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.

Other options:

For a foolproof, simple visualisation, try the geometry generator.

  1. Go to Layer Styling panel -> select style -> Symbol layer type: Geometry generator
  2. select Geometry type: Polygon/Multipolygon
  3. enter the following expression buffer($geometry,AMOUNT)
  4. AMOUNT can be a fixed number in the units of your CRS, or a field in your data - in which case it would be buffer($geometry,"buffer_field")
  5. 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.

  1. Go to Layer -> Add Layer -> Add/Edit Virtual Layer
  2. click Import and select your layer
  3. 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.
  4. 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)
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.