Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122173669
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
Wed, Jul 16, 08:32
Size
807 B
Mime Type
text/x-shellscript
Expires
Fri, Jul 18, 08:32 (12 h, 40 m)
Engine
blob
Format
Raw Data
Handle
27444526
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