Geography Reference
In-Depth Information
Exporting Rasters from GRASS
For the colorized hillshade, we used
r.out.tiff
to create a com-
posite image from each of the raster maps (red, green, and
blue) created by
r.his
. Compositing the maps results in some
reduction of color, although this likely won't be noticeable to
the human eye.
For exporting single band rasters,
r.out.gdal
is a better choice.
This is because a three-band image is always created by
r.out.tiff
, even though you specify a single GRASS raster as input.
for each DEM, adding a line containing “PIXELTYPE SIGNEDINT.” This
ensures that the DEMs will be imported correctly (for more information,
see the
r.in.gdal
manual page). Once we have the DEMs all unpacked and
the .
HDR
files properly edited, we can import them into our
world_lat_lon
location in GRASS using
r.in.gdal
:
r.in.gdal -e input=./gtopo30/W060N40.DEM output=w060n40
r.in.gdal -e input=./gtopo30/W060N90.DEM output=w060n90
r.in.gdal -e input=./gtopo30/W060S10.DEM output=w060s10
r.in.gdal -e input=./gtopo30/W100N40.DEM output=w100n40
r.in.gdal -e input=./gtopo30/W100N90.DEM output=w100n90
r.in.gdal -e input=./gtopo30/W100S10.DEM output=w100s10
r.in.gdal -e input=./gtopo30/W140N40.DEM output=w140n40
r.in.gdal -e input=./gtopo30/W140N90.DEM output=w140n90
r.in.gdal -e input=./gtopo30/W180N90.DEM output=w180n90
We could use the DEMs as is, loading each into GRASS or QGIS for
display purposes. However, if we want to do some analysis or even cre-
ate a combined shaded relief map, we need to put them all together. To
do this, we use the GRASS
r.patch
command. The usage for
r.patch
is
pretty simple. All you do is provide a list of input DEMs and a name
for the output. There are a couple of caveats, though. First, of course,
you have to have a GRASS location for the area of interest, and sec-
ond, make sure you set your GRASS region to the area covered by the
combined DEMs. You can set the region using
g.region
. To “patch” the
DEMs together, we use the following:
r.patch input=w060n40,w060n90,w060s10,w100n40,w100n90,w100s10, \
w140n40,w140n90,w180n90 output=americas_dem
We just created a merged DEM named
americas_dem
, consisting of nine
Search WWH ::
Custom Search