I have 4k point shapefiles, from which I would like to generate heatmap TIFFs using the QGIS heatmap plugin (or a functional equivalent featuring triweigth, radius and cell size selection). Is there any way to batch / script / automate this? I.e. "add vector shapefile, run heatmap plugin with specific options, remove vector shapefile and raster heatmap, add next vector shapefile, repeat..."?
Answer
For all I figured out, it is not possible to automate the heatmap - but GRASS has triweight KDE estimates, and CAN be scripted. Here is the general setup, to be put into a BASH file:
Heatmap generation from constituency.shp to constituency.tif would be like this (at the bottom of the BASH file):
v.in.ogr -e dsn=${GRASS_DBASE_EXAMPLE}/constituency.shp output=vector_layer ty$
g.mapset mapset=PERMANENT location=vector_location
g.region res=.0001
v.kernel --verbose -o input=vector_layer kernel=triweight output=raster_layer stddeviation=0.03
r.out.gdal input=raster_layer output=constituency.tif nodata=0
No comments:
Post a Comment