Skip to content
Prev 4905 / 29559 Next

calculate raster values based on vector regions

My appologies. The previous script had few (5) typos:
# load the gridded map:
# convert the polygon map to a raster map:
INPUT="polygons.shp", FIELD=1, LINE_TYPE=0, USER_CELL_SIZE=cellsize,
USER_X_EXTENT_MIN=rastermap at bbox[1,1]+cellsize, USER_X_EXTENT_MAX=rastermap at bbox[1,2]-cellsize,
USER_Y_EXTENT_MIN=rastermap at bbox[2,1]+cellsize, USER_Y_EXTENT_MAX=rastermap at bbox[2,2]-cellsize))
# summary statistics per polygon class:
$polygons))))
HTH

Tom Hengl
http://spatial-analyst.net