[QGIS Commit] r14302 - docs/branches/1.4.0/italian/user_guide

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Sep 27 17:10:33 EDT 2010


Author: alesarrett
Date: 2010-09-27 21:10:33 +0000 (Mon, 27 Sep 2010)
New Revision: 14302

Modified:
   docs/branches/1.4.0/italian/user_guide/grass_integration.tex
Log:
grass_integration.tex it translation update
- added "9.9.2. GRASS module examples" subsubsection

Modified: docs/branches/1.4.0/italian/user_guide/grass_integration.tex
===================================================================
--- docs/branches/1.4.0/italian/user_guide/grass_integration.tex	2010-09-27 21:08:11 UTC (rev 14301)
+++ docs/branches/1.4.0/italian/user_guide/grass_integration.tex	2010-09-27 21:10:33 UTC (rev 14302)
@@ -643,6 +643,226 @@
 }
 \end{Tip} 
 
+\subsubsection{GRASS module examples}\index{GRASS!toolbox}
+The following examples will demonstrate the power of some of the GRASS modules. 
+
+\minisec{Creating contour lines} 
+
+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}. 
+
+\begin{itemize}
+\item First open the location by clicking the
+\toolbtntwo{grass_open_mapset}{Open mapset} button and choosing the Alaska
+location. 
+\item 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.
+\item Now open the Toolbox with the \toolbtntwo{grass_tools}{Open GRASS
+tools} button. 
+\item In the list of tool categories double click Raster -> Surface
+Management -> Generate vector contour lines. 
+\item 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}. 
+\item Type into the \inputtext{Increment between Contour levels}{100} the
+value 100. (This will create contour lines at intervals of
+100 meters.)
+\item Type into the \inputtext{Name for output vector map}{ctour\_100}
+the name \usertext{ctour\_100}. 
+\item 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}. 
+\end{itemize}
+
+\begin{figure}[h]
+\centering
+\caption{GRASS Toolbox r.contour module \nixcaption}\label{fig:grass_toolbox_rcontour}
+   \subfigure[r.contour Options] {\label{subfig:grass_toolbox_rcontour}\includegraphics[clip=true, width=0.4\textwidth]{grass_toolbox_rcontour}}\goodgap
+   \subfigure[r.contour Output] {\label{subfig:grass_toolbox_rcontour2}\includegraphics[clip=true, width=0.4\textwidth]{grass_toolbox_rcontour2}}\goodgap
+\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 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 \dropmenuopt{Simplify
+geometries} tool that works just like the GRASS \classname{v.generalize}
+Douglas-Peuker algorithm. 
+}
+\end{Tip}  
+
+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.
+
+\begin{itemize}
+\item 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. 
+\item Check that the \usertext{ctour\_100} vector appears as the
+\inputtext{Name of input vector}{ctour\_100}. 
+\item 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}.
+\item The process takes several moments. Once \usertext{Successfully
+finished} appears in the output windows, click \button{View output} and then
+\button{close}. 
+\item 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.
+\end{itemize}
+
+\begin{figure}[h]
+ \begin{center}
+ \caption{GRASS module v.generalize to smooth a vector map \nixcaption}\label{fig:grass_toolbox_vgeneralize}
+ \includegraphics[clip=true, width=14cm]{grass_toolbox_vgeneralize}
+ \end{center}
+\end{figure}
+
+\begin{Tip}\caption{\textsc{Other uses for r.contour}}\index{GRASS!toolbox}
+\qgistip{The procedure described above can be used in other equivalent
+situations. If you have a raster map of precipitation data, for example, then
+the same method will be used to create a vector map of isohyetal (constant
+rainfall) lines 
+}
+\end{Tip}  
+
+\minisec{Creating a Hillshade 3D effect}
+
+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{itemize}
+\item 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. 
+\item Then click \classname{r.shaded.relief} to open
+the module. 
+\item 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}. 
+\item When the process completes, add the hillshade raster to the map. You
+should see it displayed in grayscale. 
+\item 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\%. 
+\end{itemize}
+
+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.
+
+\minisec{Using the GRASS shell}
+ 
+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.
+
+\begin{figure}[ht]
+ \begin{center}
+ \caption{The GRASS shell, r.shaded.relief module \nixcaption}\label{fig:grass_toolbox_shell}
+ \includegraphics[clip=true, width=12cm]{grass_toolbox_shell}
+ \end{center}
+\end{figure}
+
+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. 
+
+\begin{itemize}
+\item 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}.
+\end{itemize}
+
+\begin{itemize}
+\item After the process finishes shift to the \tab{Browse} tab and double click on
+the new \usertext{gtopo30\_shade2} raster to display in QGIS. 
+\item 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.
+\end{itemize}
+
+\begin{figure}[ht]
+ \begin{center}
+ \caption{Displaying shaded relief created with the GRASS module
+r.shaded.relief \nixcaption}\label{fig:grass_toolbox_shadedrelief}
+ \includegraphics[clip=true, width=12cm]{grass_toolbox_shadedrelief}
+ \end{center}
+\end{figure}
+
+\minisec{Raster statistics in a vector map}
+
+The next example shows how a GRASS module can aggregate raster data and add
+columns of statistics for each polygon in a vector map. 
+
+\begin{itemize}
+\item 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. 
+\item 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). 
+\item From the toolbox choose Vector -> Manage features, and open the
+module \classname{v.centroids}. 
+\item Enter as the \inputtext{output vector map}{\usertext{forest\_areas}}
+and run the module. 
+\item 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).
+\item Next reopen the GRASS toolbox and open Vector -> Vector update by other
+maps.
+\item Click on the \classname{v.rast.stats} module. Enter \inputtext{Name of
+raster}{\usertext{gtopo30}}, and \inputtext{Name of vector
+polygon}{\usertext{forest\_areas}}. 
+\item 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).
+\item 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.
+\end{itemize}
+
 \subsubsection{Lavorare con il browser delle LOCATION GRASS} \index{GRASS!strumenti!browser}
 
 Un'altra utile funzione tra quelle presenti negli strumenti GRASS è il browser



More information about the QGIS-commit mailing list