Page MenuHomec4science

plot_GVA_1301-13_LV95_visibility.sh
No OneTemporary

File Metadata

Created
Thu, May 1, 18:20

plot_GVA_1301-13_LV95_visibility.sh

#!/bin/bash
################## USER SETTINGS ##############
WORKDIR=/scratch/walch/grassgis/workdir
PLOTDIR=/scratch/walch/grassgis/canvas
LOCATION=GVA_1301-13_LV95
VISIBILITY=$1 # visibility threshold in percent
METHOD=$2 # choose from COMBI, HORIZON, RELIEF
RESOLUTION=20
###############################################
# Layer names
ELEVATION=DOM_GVA_50cm
ROOFTOP_MASK=SON_GVA_50cm_all
## Set region
g.region raster=$ELEVATION
REGION=current
# Open canvas for plotting
d.mon start=png resolution=$RESOLUTION output=$PLOTDIR\/$METHOD\_examples.png --overwrite
# Declare expression and create visibility map
SOURCE_MAP=$METHOD\_MEAN
TARGET_MAP=$METHOD\_VIS_$VISIBILITY
EXPRESSION="$TARGET_MAP = (($SOURCE_MAP*100)>$VISIBILITY)*$SOURCE_MAP"
r.mapcalc expression="$EXPRESSION" region=$REGION
# set colors of maps to plot
r.colors map=$ELEVATION color=grey
r.colors map=$TARGET_MAP color=viridis
d.erase; d.rast $ELEVATION; d.rast $TARGET_MAP ; d.legend -s $TARGET_MAP
d.mon stop=png

Event Timeline