Page MenuHomec4science

merge_dom.sh
No OneTemporary

File Metadata

Created
Thu, May 1, 01:33

merge_dom.sh

#!/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