I am trying to compute population affected by various distances, during earthquake events. The earthquake point events update every minute and I need to find a way how to create automatic buffers and get real time statistics. At the moment, I have point data and have used geometry generator polygons to create the buffer affect for 5km, 10km and 20km (as can be seen via attachment). What is the best way to calculate zonal statistics using these polygons created through geometry generator? enter image description here

I am also using Print Composer Atlas to export these maps in real time and would like to add the affected population for each buffer through a legend key on the map below. Is there any way I can do this?enter image description here


Unfortunately, you can't use geometries created with the geometry generator for geoprocessing. Geometry generator does not create actual geometries, but only symbolsation for visualization purpose. What you want to do can be probably best achieved using a virtual layer: this creates dynamic geometries based on one or more input layers.

Go to Menu Layer / Create layer / New virtual layer. Supposing that your point layer representing the earthquakes is named earthquakes, you can use the following query to create three buffers of 5, 10 and 20 km for each point:

select fid, st_buffer (e.geometry, 5000)
from earthquakes as e
select fid, st_buffer (e.geometry, 10000)
from earthquakes as e
select fid, st_buffer (e.geometry, 20000)
from earthquakes as e

Now you can use these (dynamic) geometries from the virtual layer for your zonal statistics (using your normal workflow). enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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