TransWikia.com

Geometry Generator and Zonal Statistics

Geographic Information Systems Asked on April 29, 2021

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

One Answer

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
union
select fid, st_buffer (e.geometry, 10000)
from earthquakes as e
union
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

Answered by Babel on April 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP