Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111219313
merge_dom_cells.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
Wed, Apr 30, 05:57
Size
708 B
Mime Type
text/x-shellscript
Expires
Fri, May 2, 05:57 (2 d)
Engine
blob
Format
Raw Data
Handle
25880370
Attached To
R8800 solar_potential
merge_dom_cells.sh
View Options
#!/bin/bash
## == Print inputs (for logging purposes only)
echo
echo Entered grass script
echo
echo Path to DOM cells: $1
echo File with DOM cells to merge: $2
echo New layer name: $3
## == read DOM cells from the file
MYPATH=$1
while read DOM_CELL; do
echo $DOM_CELL
name="${DOM_CELL%.*}"
r.in.gdal -o input=$MYPATH\/$name\.asc output=TMP_$name
done < $2
## == get a list of all DOM cells and set the region spanning all
MAPS=`g.list type=raster sep=',' pattern=TMP_*`
g.region -p raster=$MAPS
# patch all cells together to one
r.patch input=$MAPS output=$3 --overwrite
# remove the individual parts
g.remove -f type=raster pattern=TMP_*
echo
echo Finished executing grass script
echo
Event Timeline
Log In to Comment