If you find this document usefull, please consider ordering a printed hardcopy!



6 Digitizing with GRASS

During the redesign of the vector features the digitizing module v.digit has also been rewritten. The module is implemented via a separate graphical menu in which the most important features are integrated as buttons.

Figure 20: Digitizing GUI of the module v.digit
\includegraphics[clip=true, width=\textwidth]{vdigit}

Before introducing a short example illustrating the usage of the new digitizing module, all important features and their properties are described briefly by means of figure 20 (from left to right).

Digitize new point: is used in order to digitize a new vector point. The module function options are layer allocation to be chosen and the category value of the point. In this case the following possibilities are available: 'no category', 'manual entry' and 'next not used'. If an appropriate attribute table is available in the database, it is automatically opened after the feature has been digitized (see figure 23). These options also apply to Digitize new line, Digitize new boundary, and Digitize new centroid described below.

Digitize new line: is used in order to digitize a new vector line.

Digitize new boundary: is used in order to digitize a new closed boundary (vector line). If an appropriate attribute table is available in the database, it is automatically opened after the feature has been digitized. If an area is digitized, the attributes to be allocated to this area are not connected to the boundary but to a centroid. This centroid is thus inserted into the new digitized area (see also feature Digitize new centroid). Therefore you need to set the category mode to 'no category' when Digitize new boundary and want to end up in areas.

Digitize new centroid: is used in order to digitize a new centroid within a new area. If an appropriate attribute table is available in the database, it is automatically opened after the feature has been digitized. Attributes are connected with areas via centroids.

Move vertex: allows users to displace vertices. Attributes can not be attached to vertices. Also note that vertices are not nodes. Vector points and centroids are never vertices and cannot be changed by this function. The same applies for Add vertes, and Remove vertex.

Add vertex: allows users to add vertices.

Remove vertex: allows users to delete vertices.

Split line: makes it possible to interrupt a line at any position. Here, a new node is set for connecting additional lines as well as for attaching additional attributes.

Move point, line, boundary or centroid: allows users to displace vector points, vector lines and centroids. If an area is disconnected by several nodes, the total area is not displaced, only the appropriate boundary.

Delete point, line, boundary or centroid: allows users to delete vector points, vector lines, and centroids. If an area is disconnected by several nodes, the total area is not deleted, only the appropriate boundary.

Zoom in by window: allows to zoom in the map by means of a window defined by the mouse. Accordingly, the assignment of the mouse buttons changes and is graphically displayed in parallel in the menu. The mouse button allocation is identical to the module d.zoom.

Zoom out: with this button the user can automatically zoom out of the map in defined increments.

Pan: allows the user to pan on the map. The increment of the displacement is internally defined and can not be influenced. Currently, a connection between the pan-module and the digitization module is still missing. Also a 'rubber band' function which allows the displacement during the digitization without interrupting the process is not yet available.

Zoom to default region: sets the extent of the project to the default region (g.region -d) and re-displays the maps.

Zoom to region: sets the extent of the project to a former saved region. A 'region' can be saved via the command g.region and the option save=.

Redraw: deletes the content of the monitor and redraws its content. This function is necessary, for instance, when changing settings for the background map.

Display categories: makes it possible to display and also change category values and layer allocation of individual features (points, lines, boundaries and centroids) by selecting them with the mouse.

Display attributes: makes it possible to display and also change attribute values of individual features (points, lines, boundaries and centroids) by selecting them with the mouse. The layer allocation, the category value as well as the key column are displayed as additional information. Optionally the 'encoding' can also be controlled when saving attributes. The current possibilities are utf-8, ascii, iso8859-1 and koi8-r.

Open settings: allows users to make different basic settings for the digitization process. This includes the function for changing the symbol color for the display in the monitor (symbology). The setting of the 'snapping thresholds' done in pixel units or map units (settings). Users can also create an attribute-table (Table). The determination of background maps can be carried out on whose basis it is supposed to be digitized. This can deal with several maps in vector or raster format (background).

Exit: After the digitization is finished, leave the module v.digit with the Exit-Button. All edits are saved within the map as well as and an automatic reorganization of the topology will be done.

Sample application for digitization

A few topographical information based on the TK 1:24000 (see figure 21) of the Spearfish region are supposed to be digitized as an example of digitization. The topographical map for the GRASS example dataset 'Spearfish' has explicitly been released by the South Dakota Geological Survey (SDGS) for teaching purposes with GRASS GIS. This is already prepared and can be downloaded at http://grass.itc.it/download/data.php.

Importing the TK24 into the Spearfish dataset

# Download Spearfish demonstration location and TK24
wget http://grass.itc.it/sampledata/spearfish_grass57data.tar.gz
wget http://grass.itc.it/sampledata/spearfish_toposheet.tar.gz

# Unpack Spearfish location in grassdata and start GRASS
tar xvzf spearfish_grass57data.tar.gz /home/user/grassdata/
grass60 /home/user/grassdata/spearfish57/PERMANENT

# Importing TK24 (GeoTiff) into the location
tar xvzf spearfish_toposheet.tar.gz 
r.in.gdal -e in=spearfish_topo24.tif out=tk24

# Visual control
g.region rast=tk24 -ap 
d.mon x0 d.rast tk24

For training purposes the local recreation area around 'Lookout Peak' east of Spearfish is supposed to be recorded. In order to register points, lines and area data the point of interest 'Lookout Peak', height information and forest areas are digitized into three thematic maps (see figure 21).

Figure 21: Topographical map of the Spearfish region including landuse information
\includegraphics[clip=true, width=\textwidth]{tkspearfish}

To save the newly created vector data in a separate user-specific mapset, you need to exit GRASS (in order to exit the location PERMANENT) and start again with a new mapset:

# Exit GRASS
exit

# Start GRASS again and create a new mapset
grass60 (indicate the new name of the mapset in GUI or in the console) 
[STRG][ESC]

Viewpoint 'Lookout Peak'

For digitizing the point of interest 'Lookout Peak' the module v.digit is started and a new map lookout is created by the option -n. The imported topographic map tk24 is loaded as the background map:

# Start digitizing module and create new blank map
d.mon x0 
g.region rast=tk24 
v.digit -n map=lookout bgcmd="d.rast tk24"

Now, the graphical user interface (GUI) of the module v.digit (see figure 20) is automatically started and the TK24 is loaded into the GRASS monitor x0 as the background image. Now create a new attribute table including an extra column Name in the v.digit GUI using the settings -> Table button (see figure 22).

Figure 22: Creating an attribute table during digitization
\includegraphics[clip=true, width=0.6\textwidth]{creatab}

Afterwards, zoom into the map range east of the city of Spearfish and there digitize a point where the point of interest 'Lookout Peak' is located (see figure 21). To do this, click on the button digitize new point, search for the correct point on the map and click on this point with the left mouse button.

A graphical window is now automatically been opened in which it is possible to assign additional attributes to the point according to the attribute columns defined beforehand. In this exercise the category value is supposed to be supplemented by the name of the viewpoint. Click with the mouse in the window and enter 'Lookout Peak' in the column Name and then click on the button submit in order to add the new entry to the attribute table. This is confirmed by the message Record successfully updated.

Now, cloes the v.digit module by clicking on the Exit button. Thus, the created map lookout is automatically saved and its topology is built:

Building topology ...
1 primitives registered
0 areas built      0%
0 isles built
Topology was built.
Number of nodes     :   1
Number of primitives:   1
Number of points    :   1
Number of lines     :   0
Number of boundaries:   0
Number of centroids :   0
Number of areas     :   0
Number of isles     :   0

Digitizing contour-lines

The next exercise is to digitize the 100m contour-lines situated around the point of interest. As in the previous example, the module v.digit is started again and a new map contour_lines is automatically created by the option -n. The imported topographical map tk24 is loaded as the background map:

# Start the digitizing module and create new blank map
d.mon x0 
g.region rast=tk24 
v.digit -n map=contour_lines bgcmd="d.rast tk24"

The graphical user interface (GUI) of the module v.digit (see figure 20) is automatically started and the TK24 is loaded into the GRASS monitor x0 as the background map. Now create a new attribute table including an extra column height in the v.digit GUI using the button settings -> Table (see figure 22).

The next step is to zoom into the region east of Spearfish again (see figure 21) and to start digitizing the lines by clicking on the button digitize new line. Afterwards, choose a primary line in the monitor which should be digitized with the left mouse button. The assignment of the mouse buttons can be found in the GUI. Here it is also possible to determine the layer-entry and the kind of the allocation of the category values.

Figure 23: Attribute entry during digitization
\includegraphics[width=0.5\textwidth]{digatt}

According to the completion of the digitization of a line a graphical window is opened in which it is possible to assign additional attributes according to the attribute columns defined beforehand (see figure 23). In this exercise the category value is supposed to be supplemented by the elevation of the line. Click in the window and enter the elevation (e.g. 4200) in the column height and then click on the button submit in order to adopt the new entry in the attribute table. This is confirmed by the message Record successfully updated.

Once the digitization is complete, exit the module v.digit with the button Exit. Thus, the map contour_lines is automatically saved and its topology is built:

Building topology ...
825 primitives registered
0 areas built
0 isles built
Topology was built.
Number of nodes     :   203
Number of primitives:   249
Number of points    :   0
Number of lines     :   249
Number of boundaries:   0
Number of centroids :   0
Number of areas     :   0
Number of isles     :   0

Forest areas east of Spearfish

Finally, the forest area surrounding the landmark is to be digitized. Also in this case, the module v.digit is started and a new map forest is automatically created by the option -n. The imported topological map tk24 is loaded as background map:

# Start the digitizing module and create new blank map
g.region rast=tk24 
d.mon x0 
v.digit -n map=forest bgcmd="d.rast tk24"

The GUI of the module v.digit (see figure 20) is automatically started again and the TK24 is loaded in the GRASS monitor x0 as background map. A new attribute table including an extra column Name is now newly created in the v.digit GUI via the button settings -> Table (see figure 22).

Then zoom into the region east of Spearfish (see figure 21) and start to digitize the forest areas by clicking on the button digitize new boundary and by searching an initial range on the monitor for the digitization. The assignment of the mouse buttons can be found in the GUI. Here, it is also possible to determine the layer-entry and the kind of the allocation of the category values. For digitizing the forest areas change the mode from 'Next not used' to 'no category'. The reason is that the area attributes are not supposed to be connected to the boundaries but to the centroids.

It is important to set the snapping threshold correctly so that lines are snapped together properly. The default setting for the snapping threshold is 10 screen pixels but can be adapted to your own requirements using the button settings -> settings (see figure 24).

Figure 24: Settings of the snapping threshold during digitization
\includegraphics[clip=true, width=0.6\textwidth]{threshold}

If a boundary has been digitized, a centroid is supplemented to the area so that attributes can be connected with the area. For this purpose, click on the button digitize new centroid, change the Mode from 'no category' to 'Next not used' and search on the monitor for an appropriate point within the newly created area in order to place the centroid. If the centroid has been set with the left mouse button, a graphical window is opened in which it is possible to assign additional attributes to the already set point according to the attribute columns defined before (see figure 23). In this training only the category value is supposed to be supplemented by the landuse type. Click into the window and enter the landuse type forest into the column Name. Click the button submit in order to update the new entry in the attribute table. This is confirmed by the message Record successfully updated.

Once the digitization is complete, exit the module v.digit using the button Exit. Thus, the map forest is automatically saved and its topology is built:

Building topology ...
478 primitives registered
46 areas built
 isles built
Topology was built.
Number of nodes     :   357
Number of primitives:   478
Number of points    :   0
Number of lines     :   0
Number of boundaries:   367
Number of centroids :   46
Number of areas     :   46
Number of isles     :   0


If you find this document usefull, please consider ordering a printed hardcopy!


© 2005, GDF Hannover bR - Solutions for spatial data analysis and remote sensing
Last modified: 29-08-2005