Data display and visualization
Resources:
- GRASS GIS overview and manual
- Recommendations how to use GUI from the first assignment
- Screen captures for 3D visualization with 3D view (wxNVIZ) in GRASS GIS 6.4.3RC2 (similar to GRASS GIS 7 and 8)
- Visualization in GRASS I: surface
- Visualization in GRASS II: draping points and lines (legend does not work in GRASS8.4)
- Visualization in GRASS III: cutting planes
Start GRASS GIS
Your current mapset should be a previously created assignment2 in the nc_spm_08_grass7 project, you can continue working in it or create a new mapset (e.g., assignment2b) following the instructions from the previous assignments.
To save your outputs and to store external data change your working directory
to the one that you created in previous assignment e.g.,
C:\Users\myname\Documents\GIS582_HW\report2,
type cd
into Console and hit Enter:
cd
then browse to and select your report2 directory.
Changing the default font
Change the default font used for map rendering in GUI Settings: File > Preferences > Map Display. Pick a new default font and Save the settings.Note, that you can also change the default color table, default vector display properties and other display behavior in GUI settings.
Basic 2D display operations
GUI is recommended for the tasks below, see the GUI equivalents for selected d* commands, the command line instructions below are to indicate the workflow and output.Display color composite and a subset of raster data
Visualy explore the development in the 1996 land use map layer and the 2002 landsat imagery using similar approach as with the shaded elevation above, but here we use a landsat 2002 image compositeIn Layer Manager: Add various raster map layers > Add RGBmap layer.
d.erase
g.region raster=landuse96_28m -p
d.rgb red=lsat7_2002_30 green=lsat7_2002_20 blue=lsat7_2002_10
d.rast landuse96_28m values=1,2
#make sure to change opacity of the landuse layer to see the developed areas in 2002 and 1996
d.vect roadsmajor color=yellow
d.out.file mylandsat
How did the developed area change between 1996 and 2002?
Change colors for raster maps
There are many ways how to adjust or create custom color ramps for raster maps, see r.colors manual, we explore only some basic tools here.Compare the use of equal interval and histogram equalized color table for slope
First, we create our copy of the slope map and then display it with an equal interval color ramp with colors ranging from blue-green-yellow to red (bgyr). To add the legend use Add map elements button on Map Display.g.copy raster=slope,myslope
r.colors myslope color=bgyr
d.rast myslope
d.legend myslope
d.out.file myslopecolor
Now change to the histogram equalized color table, and save the new slope map.
r.colors -e myslope color=bgyr
d.out.file myslopecolorequalized
To explain the difference between the two maps, you can generate a histogram. On Map Display click on Analyze map > Create histogram with d.histogram to open the histogram tool and save results to graphics file. Or use this command which will add a histogram as a layer to Layer Manager and then save the image:
d.histogram myslope
d.out.file slopehistogram
If you want to remove the orange rectangle in the display that shows the extent
of computational region click on "Map Display Settings" icon on the top
of the map display and switch of "Show computational extent".
You can put it back whenever you need it and you can adjust other
Map display settings there as well.
What is the effect of the histogram equalized color table on the slope map pattern?
Modify legend, scale and grid
To re-size the legend for myslope, right click on the legend, select Resize legend and resize with mouse. Alternatively you can resize by selecting Pointer mode in Map Display, double clicking on legend to launch the legend dialog and set options > Optional > Placement > 50,90,4,7.Numbers are bottom,top,left,right as percentage of screen coordinates.
Add units to the legend: Add map elements > Add text layer > type deg > OK.
Add barscale on Map Display: Add map elements > Add scale bar (double click on it to change iti, for example you can change its length and units under Optional tab).
Note: you can use horizontal legends by using Placement at=6,10,2,30 or just stretch it horizontally with mouse.
d.barscale length=1000
d.legend myslope at=50,90,4,7
Add grid for state plane coordinates at 5000m with ticks at 1000m. Also add a lat/long grid at 2 arc minute interval.
In Layer Manager > Add various overlays > Add grid layer > Size 5000 > Run.
To draw only border with ticks: change Size to 1000 and click Disable > Disable grid drawing > Run.
Switch off Disable grid drawing.
To draw lat/long grid: set Required > Size to 0:02 > click Draw > Draw geographic grid > Run.
Command line alternative:
d.grid size=5000 color=brown
d.grid -n size=1000
d.out.file myslopemap_gridxy
#switch off previous grids
d.grid -g size=0:02 color=black
d.out.file myslopemap_gridlatlong
Visualization in 3D perspective
Interactively view "elevation" raster and vector data ("streams", "usgsgages") in 3D view, adjust viewing position, surface properties and lighting to highlight features and display landuse data over topography. Note, that legend is not currently supported in 3D view. Remove or switch off any map layers in the Layer Manager (if you have any) and set region to the raster "elevation".
d.erase
g.region raster=elevation -p
Then add raster "elevation", and vector "streams", and "usgsgages".
Zoom to computational region and Switch to 3D view.
Follow the video Visualization in GRASS I: surface and Visualization in GRASS II: draping points and lines(legend does not work in GRASS8.4) and save 2-3 images for your report (save as tiff or take screenshot, if you don't have tiff support).
Optional
Visualizing multiple surfaces
Visualize multiple surfaces (bare earth and surface with vegetation and structures),analyze their relationship using crossections generated by interactive cutting planes
It is recommended to quit GRASS before starting the task below because we will be working with a smaller, high resolution region.
Start grass with your previous mapset. First set region to "rural_1m", then interpolate surface with vegetation from multiple return lidar points using the module v.surf.rst (we will explain interpolation later on).
g.region rural_1m -p
v.surf.rst input=elev_lidrural_mrpts elevation=elev_lidruralmr_1m npmin=120 segmax=25 tension=40 smooth=1.0
In Layer Manager Add rasters "elev_lidruralmr_1m" and "elev_lid792_1m" (bare earth). In Map Display Zoom to computational region.
Make sure that you have only the two elevation maps switched on in the Layer Manager. Switch to 3D view and follow the video Visualization in GRASS III: cutting planes. Save 2-3 interesting images for your report, include at least one crossection. If you do not see the elevation surfaces click Look: "center" in the View pannel of the 3D view.
Optional
Map Swipe
Use mapswipe to compare the new orthophoto with the ortho provided in the data set:g.mapsets mapset=assignment1 operation=add
File > Map Swipe.Add raster > select "ortho_2001_t792_1m" and "ortho_new".
Move slider to compare images - what changes do you observe? Save a screenshot of the mapswipe window showing the comparison of orthos. See more options here.