Geography Reference
In-Depth Information
Success! We stumbled across a bit of a problem initially, but this served
to illustrate some problem-solving tools and techniques at our disposal.
You should note that you won't encounter the offset issue with every
raster you import. If you are importing a GeoTIFF that contains coordi-
nate information, odds are it will be processed just fine. If not, you are
now prepared to deal with the problem.
The last thing we want to do is color-composite the image for display
purposes. The import processed each band of the image separately,
creating separate outputs for red, green, blue, and the alpha channel.
We can combine these together so the image looks like we expect using
r.composite :
GRASS 6.2.2 (world_lat_lon):~ > r.composite red=world_mosaic.red \
green=world_mosaic.green blue=world_mosaic.blue output=world_mosaic
...
GRASS 6.2.2 (world_lat_lon):~ >
In Figure C.7 , on the following page, you can see the world mosaic dis-
played in GRASS. You might notice it looks a little “blocky.” If you zoom
in, you will find it loses the detail we had in the original TIFF image.
We should have set the region to that of the raster before creating the
composite; otherwise, GRASS uses the default region specified when
we created the location. To get the results we want, we can compos-
ite the image again, after setting the region using one of the rasters
( world_mosaic.red ) created during the import:
GRASS 6.2.2 (world_lat_lon):~ > g.region rast=world_mosaic.red
GRASS 6.2.2 (world_lat_lon):~ > r.composite red=world_mosaic.red \
green=world_mosaic.green blue=world_mosaic.blue output=world_mosaic_better
...
GRASS 6.2.2 (world_lat_lon):~ >
Now we have a proper looking raster that preserves the resolution of
the original TIFF file.
Importing with QGIS
Now let's look at using QGIS to import a layer into GRASS. After QGIS is
fired up, open the mapset we want to use for storing our data. To open
a mapset, choose Open mapset from the GRASS menu under the main
Plugins menu. Make the appropriate selections for location and mapset,
and press OK. Nothing much happens when you do this, other than the
GRASS toolbox icon will now be enabled. Now that the mapset is open,
we need to load the shapefile we want to import. To import a shapefile
 
 
Search WWH ::




Custom Search