Page MenuHomec4science

merge_dom.sh
No OneTemporary

File Metadata

Created
Fri, May 16, 15:41

merge_dom.sh

#!/bin/bash
## -------------------
## $1: directoy file (command line argument to new location)
## $2: new layer name
# 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=$DOM_CELL output=TMP_$name
done < $1
# 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
# patch all cells together to one
r.patch input=$MAPS output=$2
# remove the individual parts
g.remove -f type=raster pattern=TMP_*

Event Timeline