Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111450510
plot_GVA_1301-13_LV95_visibility.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, May 1, 18:20
Size
1002 B
Mime Type
text/x-shellscript
Expires
Sat, May 3, 18:20 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25915225
Attached To
R8800 solar_potential
plot_GVA_1301-13_LV95_visibility.sh
View Options
#!/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
Log In to Comment