[QGIS Commit] r11398 - in docs/trunk/english_us/user_guide: . grass_integration_screenies

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Aug 16 15:31:29 EDT 2009


Author: micha
Date: 2009-08-16 15:31:28 -0400 (Sun, 16 Aug 2009)
New Revision: 11398

Added:
   docs/trunk/english_us/user_guide/grass_integration_screenies/grass_toolbox_shadedrelief.png
   docs/trunk/english_us/user_guide/grass_integration_screenies/grass_toolbox_shell.png
Modified:
   docs/trunk/english_us/user_guide/grass_integration.tex
Log:
Fixed some formatting and display conventions

Modified: docs/trunk/english_us/user_guide/grass_integration.tex
===================================================================
--- docs/trunk/english_us/user_guide/grass_integration.tex	2009-08-16 16:06:12 UTC (rev 11397)
+++ docs/trunk/english_us/user_guide/grass_integration.tex	2009-08-16 19:31:28 UTC (rev 11398)
@@ -603,8 +603,8 @@
 The following examples will demonstrate the power of some of the GRASS modules. 
 
 \underline{Creating contour lines}\linebreak 
-The first example creates a vector contour map from an elevation raster (DEM).  Assuming you have the Alaska \filename{LOCATION} set up as explained in Section \ref{sec:import_loc_data}, first open the location by clicking the \toolbtntwo{grass_open_mapset}{Open mapset}  button and choosing the Alaska location. Now load the \usertext{gtopo30} elevation raster by clicking \toolbtntwo{grass_add_raster}{Add GRASS raster layer} and selecting the \usertext{gtopo30} raster from the demo location.  Now open the Toolbox with the \toolbtntwo{grass_tools}{Open GRASS tools} button.  In the list of tool categories double click Raster->Surface Management->Generate vector contour lines. Now a single click on the tool r.contour will open the tool dialog as explained above \ref{grass_modules}.
-The \usertext{gtopo30} raster should appear as the ``Name of input raster''. Type into the ``Increment between Contour levels'' the value 100. (This will create contour lines at intervals of 100 meters.) Type into the ``Name for output vector map'' the name \usertext{ctour\_100}. And click Run to start the process. Wait for several moments until the message \usertext{Successfully finished} appears in the output window. Then click View Output and close. 
+The first example creates a vector contour map from an elevation raster (DEM).  Assuming you have the Alaska \filename{LOCATION} set up as explained in Section \ref{sec:import_loc_data}, first open the location by clicking the \toolbtntwo{grass_open_mapset}{Open mapset}  button and choosing the Alaska location. Now load the \usertext{gtopo30} elevation raster by clicking \toolbtntwo{grass_add_raster}{Add GRASS raster layer} and selecting the \usertext{gtopo30} raster from the demo location.  Now open the Toolbox with the \toolbtntwo{grass_tools}{Open GRASS tools} button.  In the list of tool categories double click Raster->Surface Management->Generate vector contour lines. Now a single click on the tool \classname{r.contour} will open the tool dialog as explained above \ref{grass_modules}.
+The \usertext{gtopo30} raster should appear as the \inputtext{Name of input raster}{gtopo30}. Type into the \inputtext{Increment between Contour levels}{100} the value 100. (This will create contour lines at intervals of 100 meters.) Type into the \inputtext{Name for output vector map}{ctour\_100} the name \usertext{ctour\_100}. And click \button{Run} to start the process. Wait for several moments until the message \usertext{Successfully finished} appears in the output window. Then click \button{View Output} and \button{close}. 
 \begin{figure}[h]
 \centering
 \caption{GRASS Toolbox r.contour module \nixcaption}\label{fig:grass_toolbox_rcontour}
@@ -614,13 +614,13 @@
 \end{figure}
 Since this is a large region, it will take a while to display. After it finishes rendering, you can open the layer properties window to change the line color so that the contours appear clearly over the elevation raster, as in \ref{sec:vectorprops}.
 
-Next zoom in to a small, mountain area in the center of Alaska. Zooming in close you will notice that the contours have sharp corners. GRASS offers the v.generalize tool to slightly alter vector maps while keeping their overall shape. The tool uses several different algorithms with different purposes. Some of the algorithms (i.e. Douglas Peuker and Vertex reduction) simplify the line by removing some of the vertices. The resulting vector will load faster. This process will be used when you have a highly detailed vector, but you are creating a very small scale map, so the detail is unnecessary. 
+Next zoom in to a small mountainous area in the center of Alaska. Zooming in close you will notice that the contours have sharp corners. GRASS offers the \classname{v.generalize} tool to slightly alter vector maps while keeping their overall shape. The tool uses several different algorithms with different purposes. Some of the algorithms (i.e. Douglas Peuker and Vertex reduction) simplify the line by removing some of the vertices. The resulting vector will load faster. This process will be used when you have a highly detailed vector, but you are creating a very small scale map, so the detail is unnecessary. 
 \begin{Tip}\caption{\textsc{The simplify tool}}\index{GRASS!display results}
-\qgistip{Note that the QGIS fTools plugin has a ``Simplify geometries'' tool that works just like the GRASS v.generalize Douglas-Peuker algorithm. 
+\qgistip{Note that the QGIS fTools plugin has a \dropmenuopt{Simplify geometries} tool that works just like the GRASS \classname{v.generalize} Douglas-Peuker algorithm. 
 }
 \end{Tip}  
-The purpose of this example is different. The contour lines created by r.contour have sharp angles that should be smoothed.  Among the v.generalize algorithms there is Chaikens which does just that (also Hermite splines). Be aware that these algorithm can \textbf{add}  additional vertices to the vector, causing it to load even more slowly.
-Open the GRASS toolbox and double click the categories Vector->Develop map->Generalization, then click on the v.generalize module to open its options window. Check that the \usertext{ctour\_100} vector appears as the input vector. From the list of algorithms choose Chaiken's. Leave all other options at their default, and scroll down to the last row to enter the Name for output vector map. Enter \usertext{ctour\_100\_smooth} as the new vector name, and click Run. The process takes several moments.  Once \usertext{Successfully finished} appears in the output windows, click View output and then close. You may change the color of the vector to display it clearly on the raster background and to contrast with the original contour lines. You will notice that the new contour lines have smoother corners than the original while staying faithful to the original overall shape.
+However, the purpose of this example is different. The contour lines created by r.contour have sharp angles that should be smoothed.  Among the \classname{v.generalize} algorithms there is Chaikens which does just that (also Hermite splines). Be aware that these algorithms can \textbf{add}  additional vertices to the vector, causing it to load even more slowly.
+Open the GRASS toolbox and double click the categories Vector->Develop map->Generalization, then click on the \classname{v.generalize} module to open its options window. Check that the \usertext{ctour\_100} vector appears as the \inputtext{Name of input vector}{ctour\_100}. From the list of algorithms choose Chaiken's. Leave all other options at their default, and scroll down to the last row to enter the \inputtext{Name for output vector map}{ctour\_100\_smooth}, and click \button{Run}. The process takes several moments.  Once \usertext{Successfully finished} appears in the output windows, click \button{View output} and then \button{close}. You may change the color of the vector to display it clearly on the raster background and to contrast with the original contour lines. You will notice that the new contour lines have smoother corners than the original while staying faithful to the original overall shape.
 \begin{figure}[h]
  \begin{center}
  \caption{GRASS module v.generalize to smooth a vector map \nixcaption}\label{fig:grass_toolbox_vgeneralize}
@@ -635,11 +635,31 @@
 
 \underline{Creating a Hillshade 3D effect}\linebreak 
 Several methods are used to display elevation layers and give a 3D effect to maps. The use of contour lines as shown above is one popular method often chosen to produce topographic maps. Another way to display a 3D effect is by hillshading. The hillshade effect is created from a DEM (elevation) raster by first calculating the slope and aspect of each cell, then simulating the sun's position in the sky and giving a reflectance value to each cell. Thus you get sun facing slopes lighted and the slopes facing away from the sun (in shadow) are darkened.
-Begin this example by loading the \usertext{gtopo30} elevation raster. Start the GRASS toolbox and under the Raster category double click to open Spatial analysis->Terrain analysis. Then click r.shaded.relief to open the module. Change the azimuth angle to 315. Enter \usertext{gtopo30\_shade} for the new hillshade raster, and click run. When the process completes, add the hillshade raster to the map. You should see the hillshade raster displayed in grayscale. To view both the hill shading and the colors of the \usertext{gtopo30} together shift the hillshade map below the \usertext{gtopo30} map in the table of contents, then open the properties window of \usertext{gtopo30}, switch to the \tab{transparency} tab and set its transparency level to about 25\%. You should now have the \usertext{gtopo30} elevation with its colormap and transparency setting displayed \textbf{above} the grayscale hillshade map. In order to see the visual effects of the hillshading, turn off the \usertext{gtopo30\_shade} map, then turn it back on.
+Begin this example by loading the \usertext{gtopo30} elevation raster. Start the GRASS toolbox and under the Raster category double click to open Spatial analysis->Terrain analysis. Then click \classname{r.shaded.relief} to open the module. Change the \inputtext{azimuth angle}{270} to 315. Enter \usertext{gtopo30\_shade} for the \inputtext{Output shaded relief map}{gtopo30\_shade} new hillshade raster, and click \button{run}. When the process completes, add the hillshade raster to the map. You should see it displayed in grayscale. To view both the hill shading and the colors of the \usertext{gtopo30} together shift the hillshade map below the \usertext{gtopo30} map in the table of contents, then open the \dropmenuopt{Properties} window of \usertext{gtopo30}, switch to the \tab{transparency} tab and set its transparency level to about 25\%. You should now have the \usertext{gtopo30} elevation with its colormap and transparency setting displayed \textbf{above} the grayscale hillshade map. In order to see the visual effects of the hillshading, turn off the \usertext{gtopo30\_shade} map, then turn it back on.
 
+
+\underline{Using the GRASS shell}\linebreak 
+The GRASS plugin in QGIS is designed for users who are new to GRASS, and not familiar with all the modules and options. As such, some modules in the toolbox do not show all the options available, and some modules do not appear at all. The GRASS shell (or console) gives the user access to those additional GRASS modules that do not appear in the toolbox tree, and also to some additional options to the modules that are in the toolbox with the simplest default parameters. This example demonstrates the use of an additional option in the \classname{r.shaded.relief} module that was shown above.
+The module \classname{r.shaded.relief} can take a parameter \usertext{zmult} which multiplies the elevation values relative to the X-Y coordinate units so that the hillshade effect is even more pronounced. Load the \usertext{gtopo30} elevation raster as above, then start the GRASS toolbox and click on the GRASS shell. In the shell window type the command:\linebreak
+\usertext{r.shaded.relief map=gtopo30 shade=gtopo30\_shade2 azimuth=315 zmult=3} \linebreak and press \keystroke{Enter}
+\begin{figure}[h]
+ \begin{center}
+ \caption{The GRASS shell, r.shaded.relief module \nixcaption}\label{fig:grass_toolbox_shell}
+ \includegraphics[clip=true,width=9cm]{grass_toolbox_shell}
+ \end{center}
+\end{figure}
+
+After the process finishes shift to the \tab{Browse} tab and double click on the new \usertext{gtopo30\_shade2} raster to display in QGIS. As explained above, shift the shaded relief raster below the gtopo30 raster in the Table of Contents, then check transparency of the colored gtopo30 layer. You should see that the 3D effect stands out more strongly compared to the first shaded relief map.
+ \begin{figure}[h]
+ \begin{center}
+ \caption{Displaying shaded relief created with the GRASS module r.shaded.relief \nixcaption}\label{fig:grass_toolbox_shadedrelief}
+ \includegraphics[clip=true,width=10cm]{grass_toolbox_shadedrelief}
+ \end{center}
+\end{figure}
+
 \underline{Raster statistics in a vector map}\linebreak 
-The next example shows how a GRASS module aggregates raster data and adds columns of statistics for each polygon in a vector map. Again using the Alaska data, refer to \ref{sec:import_loc_data} to import the trees shapefile from the \usertext{vmap0\_shapefiles} directory into GRASS.  Now an intermediary step is required: centroids must be added to the imported trees map to make it a complete GRASS area vector (including boundaries with centroids).  From the toolbox choose Vector->Manage features, and open the module v.centroids. Enter as the output vector map \usertext{forest\_areas} and run the module.  Now load the \usertext{forest\_areas} vector and display the types of forests - deciduous, evergreen, mixed - in different colors: In the layer properties window, \tab{symbology} tab, choose Unique value and set the Classification field to VEGDESC. (Refer to the explanation of the symbology tab \ref{sec:symbology} in the vector section).
-Next reopen the GRASS toolbox and open Vector->Vector update by other maps. Click on the v.rast.stats module. Name of raster should be \usertext{gtopo30}, and Name of vector polygon should be \usertext{forest\_areas}. Only one additional parameter is needed: Enter \usertext{elev} as the column prefix, and click run. This is a computationally heavy operation which will run for a long time (probably up to two hours). Finally open the \usertext{forest\_areas} attribute table, and verify that several new columns have been added including \usertext{elev\_min},\usertext{elev\_max},\usertext{elev\_mean} etc for each forest polygon.
+The next example shows how a GRASS module can aggregate raster data and add columns of statistics for each polygon in a vector map. Again using the Alaska data, refer to \ref{sec:import_loc_data} to import the trees shapefile from the \usertext{vmap0\_shapefiles} directory into GRASS.  Now an intermediary step is required: centroids must be added to the imported trees map to make it a complete GRASS area vector (including both boundaries and centroids).  From the toolbox choose Vector->Manage features, and open the module \classname{v.centroids}. Enter as the \inputtext{output vector map}{\usertext{forest\_areas}} and run the module.  Now load the \usertext{forest\_areas} vector and display the types of forests - deciduous, evergreen, mixed - in different colors: In the layer \dropmenuopt{Properties} window, \tab{symbology} tab, choose \selectstring{Legend type}{Unique value} and set the \inputtext{Classification field}{VEGDESC} to VEGDESC. (Refer to the explanation of the symbology tab \ref{sec:symbology} in the vector section).
+Next reopen the GRASS toolbox and open Vector->Vector update by other maps. Click on the \classname{v.rast.stats} module. Enter \inputtext{Name of raster}{\usertext{gtopo30}}, and \inputtext{Name of vector polygon}{\usertext{forest\_areas}}. Only one additional parameter is needed: Enter \inputtext{column prefix}{\usertext{elev}}, and click \button{run}. This is a computationally heavy operation which will run for a long time (probably up to two hours). Finally open the \usertext{forest\_areas} attribute table, and verify that several new columns have been added including \usertext{elev\_min}, \usertext{elev\_max}, \usertext{elev\_mean} etc for each forest polygon.
 
 
 

Added: docs/trunk/english_us/user_guide/grass_integration_screenies/grass_toolbox_shadedrelief.png
===================================================================
(Binary files differ)


Property changes on: docs/trunk/english_us/user_guide/grass_integration_screenies/grass_toolbox_shadedrelief.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: docs/trunk/english_us/user_guide/grass_integration_screenies/grass_toolbox_shell.png
===================================================================
(Binary files differ)


Property changes on: docs/trunk/english_us/user_guide/grass_integration_screenies/grass_toolbox_shell.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream



More information about the QGIS-commit mailing list