Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111357997
merge_dom.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, 01:33
Size
807 B
Mime Type
text/x-shellscript
Expires
Sat, May 3, 01:33 (2 d)
Engine
blob
Format
Raw Data
Handle
25904533
Attached To
R8800 solar_potential
merge_dom.sh
View Options
#!/bin/bash
## -------------------
## $1: path to cells
## $2: directoy file (command line argument to new location)
## $3: new layer name
# read the DOM cells in from a given file
MYPATH=$1
echo path to read DOM cells from: $1
echo txt file for DOM cells: $2
echo new map name: $3
# read the DOM cells in from a given file
while read DOM_CELL; do
echo $DOM_CELL
base=`basename "$DOM_CELL"`
name="${base%.*}"
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 -s raster=$MAPS save=DOM_2m -p --overwrite
# patch all cells together to one
r.patch input=$MAPS output=$3 --overwrite
# remove the individual parts
g.remove -f type=raster pattern=TMP_*
Event Timeline
Log In to Comment