grass gis digitization tools -...

6
GRASS GIS DIGITIZATION TOOLS J. Čepický a , M.Landa b a ITC-irst – Via Sommarive, 18, 38050 Povo (Trento), Italy – e-mail: [email protected] b ITC-irst – Via Sommarive, 18, 38050 Povo (Trento), Italy – e-mail: [email protected] KEY WORDS: GIS, GRASS, GUI, vector, digitizing, editing, v.digit, v.edit ABSTRACT This paper is concerned with digitization tools available in GRASS GIS. As an introductory word, we present the GRASS module v.digit. This module, as the main digitization tool in GRASS, has long history. We try to describe milestones of v.digit development, its concept and especially fundamental limitations of the current version. The main objective of this paper is to introduce other GRASS module v.edit. This relatively new module is dedicated to editing vector maps via CLI (Command Line Interface). Module v.edit allows the user to modify a GRASS vector map layer (i.e. adding, deleting and modifying vector objects). A new GRASS graphical digitization tool should be built as a front-end for v.edit module based on a given GUI toolkit (e.g. GTK2, wxPython, etc.). Module v.edit is currently under heavy development. After having released a first "release" candidate (i.e. covering the fundamental features) the new GUI will be developed on the top of the v.edit functionality. This tool will be a foundation-stone of the next GRASS GUI which is planned for the future versions of GRASS. 1. INTRODUCTION GRASS GIS [http://grass.itc.it] has long tradition which is closely related to the Unix environment [http://en.wikipedia.org/wiki/Unix]. Almost all tools available in GRASS GIS (so-called GRASS modules) have command line oriented interface. CLI can be very effective for the more advanced users. On the other hand many of the newcomers to GRASS have significant problems using this user interface. It is the most important reason for having special GRASS-oriented graphical user interface. This interface would simplify GRASS usage and say make things more intuitive. An internal part of the GUI should be the georectifier, vector digitization and map composer tool. The initial step towards GUI homogenity has been done in 2006 by Michael Barton – GIS Manager is equipped with new graphic output windows. There is no longer direct dependence on the Unix environment (X11 architecture in the concrete). Basic tools for zooming, panning and data querying are available as part of the map display windows. However one of the most important GIS tools has not been ported to the new GUI – i.e. vector digitizing module v.digit. 2. HISTORY OF V.DIGIT MODULE 2.1 Curses version of v.digit History of the v.digit module dates back to the 1980s (first version of “main.c” source unit refers to 26.6.1987). This version as well as all other GRASS modules was fully CLI-oriented. Users could use defined key bindings to switch between various screens and tools. The interface was built on the Curses library [1]. It was possible to digitize all defined vector features or sites very efficiently. Some of the useful functions which were available in the first version of the v.digit module has never been implemented in the new versions, e.g. generation of the attribute of isolines (contour height).

Upload: others

Post on 13-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GRASS GIS DIGITIZATION TOOLS - cvut.czgeo.fsv.cvut.cz/~landa/publications/2007/italian-gfoss-07/grass-digit.pdfand enhancements in GRASS GUI. In the result, GRASS tools should be available

GRASS GIS DIGITIZATION TOOLS

J. Čepickýa, M.Landab

a ITC-irst – Via Sommarive, 18, 38050 Povo (Trento), Italy – e-mail: [email protected]

b ITC-irst – Via Sommarive, 18, 38050 Povo (Trento), Italy – e-mail: [email protected]

KEY WORDS: GIS, GRASS, GUI, vector, digitizing, editing, v.digit, v.edit

ABSTRACT

This paper is concerned with digitization tools available in GRASS GIS. As an introductory word, we present the GRASS module v.digit. This module, as the main digitization tool in GRASS, has long history. We try to describe milestones of v.digit development, its concept and especially fundamental limitations of the current version.

The main objective of this paper is to introduce other GRASS module v.edit. This relatively new module is dedicated to editing vector maps via CLI (Command Line Interface). Module v.edit allows the user to modify a GRASS vector map layer (i.e. adding, deleting and modifying vector objects). A new GRASS graphical digitization tool should be built as a front-end for v.edit module based on a given GUI toolkit (e.g. GTK2, wxPython, etc.). Module v.edit is currently under heavy development. After having released a first "release" candidate (i.e. covering the fundamental features) the new GUI will be developed on the top of the v.edit functionality. This tool will be a foundation-stone of the next GRASS GUI which is planned for the future versions of GRASS.

1. INTRODUCTION

GRASS GIS [http://grass.itc.it] has long tradition which is closely related to the Unix environment [http://en.wikipedia.org/wiki/Unix]. Almost all tools available in GRASS GIS (so-called GRASS modules) have command line oriented interface. CLI can be very effective for the more advanced users. On the other hand many of the newcomers to GRASS have significant problems using this user interface. It is the most important reason for having special GRASS-oriented graphical user interface. This interface would simplify GRASS usage and say make things more intuitive. An internal part of the GUI should be the georectifier, vector digitization and map composer tool.

The initial step towards GUI homogenity has been done in 2006 by Michael Barton – GIS Manager is equipped with new graphic output windows. There is no longer direct dependence on the Unix environment (X11 architecture in the concrete). Basic tools for zooming, panning and data querying are available as part of the map display windows. However one of the most important GIS tools has not been ported to the new GUI – i.e. vector digitizing module v.digit.

2. HISTORY OF V.DIGIT MODULE

2.1 Curses version of v.digit

History of the v.digit module dates back to the 1980s (first version of “main.c” source unit refers to 26.6.1987). This version as well as all other GRASS modules was fully CLI-oriented. Users could use defined key bindings to switch between various screens and tools. The interface was built on the Curses library [1]. It was possible to digitize all defined vector features or sites very efficiently. Some of the useful functions which were available in the first version of the v.digit module has never been implemented in the new versions, e.g. generation of the attribute of isolines (contour height).

Page 2: GRASS GIS DIGITIZATION TOOLS - cvut.czgeo.fsv.cvut.cz/~landa/publications/2007/italian-gfoss-07/grass-digit.pdfand enhancements in GRASS GUI. In the result, GRASS tools should be available

Figure 1: Main screen of the v.digit module in GRASS version 4.0

2.2 Tcl/Tk version of v.digit module

In 2000 Radim Blažek started working on the new GRASS vector engine. In the frame of this improvements has written new version of v.digit module based on the Tk graphical toolkit. This version has been later improved by Michael Barton (2005). From the user's point of view the Tcl/Tk v.digit implementation is more "intuitive" and the user can become familiar with the digitization tool much faster and easier then with the previous text-oriented version. However some functionality available in the old-fashioned module has not been re-implemented. This implementation heavily depends on the Xdriver. This fact makes impossible or very difficult to port v.digit to non-Unix platforms. Currently v.digit is one of the last GRASS modules which makes the GRASS MS Windows port incomplete.

Figure 2: Tcl/Tk v.digit implementation by Radim Blažek (2001)

Page 3: GRASS GIS DIGITIZATION TOOLS - cvut.czgeo.fsv.cvut.cz/~landa/publications/2007/italian-gfoss-07/grass-digit.pdfand enhancements in GRASS GUI. In the result, GRASS tools should be available

Figure 3: Improved Tcl/Tk version of v.digit by Michael Barton (GRASS GIS 6.2, 2006). This module still depends on Xdriver and uses traditional GRASS-monitor.

2.3 QGIS GRASS Plugin

Quantum GIS [http://www.qgis.org] offers robust GRASS Plugin which allows the user to visualize, process and modify GRASS data. Internal part of this plugin is the special digitization tool.

Figure 4: Editing GRASS vector map layer in QGIS via GRASS Plugin

The user can edit GRASS vector map layers directly in QGIS environment. The GRASS Plugin has been designed and implemented also by Radim Blažek. In contrast to GRASS native digitization tool the QGIS plugin-oriented implementation is usable also on MS Windows platform. In this connection, GRASS GIS is shifted to "library" position, i.e. as a back-end for analysis and computation task (or digitization). The GRASS Plugin includes GRASS Toolbox which makes available many GRASS modules directly in QGIS nature. GRASS GIS is becoming more or less dependent on 3rd party program.

Page 4: GRASS GIS DIGITIZATION TOOLS - cvut.czgeo.fsv.cvut.cz/~landa/publications/2007/italian-gfoss-07/grass-digit.pdfand enhancements in GRASS GUI. In the result, GRASS tools should be available

2.4 wxPython implementation of v.digit

In 2006 Jáchym Čepický designed new port of v.digit using wxPython [http://www.wxpython.org] toolkit. This version provides basic features of digitization tool in GIS. The main benefit for the GRASS community is testing usability of wxPython toolkit as the foundation-stone of the new GRASS GUI.

Figure 5: wxPython v.digit implementation by Jáchym Čepický (2006)

3.NEW DIRECTION IN GRASS VECTOR EDITING – V.EDIT

GRASS module v.edit is relatively new in GRASS-CVS repository. It provides non-interactive editing of GRASS vector map layers. The user can manipulate with vector features using v.edit with desired parameters. Following editing tools have been implemented:

● create - Create new vector file● add - Add new vector feature to existing vector file● delete - Delete feature from vector file● move - Move feature in vector file● vertex - Move one vertex● straight - Remove vertex● break - Add new vertex to existing vector line● merge - Merge two vector lines together● split - Split line into two separate lines● select - Select lines and print their ID's● catadd - Set new category to selected lines for defined layer● catdel - Delete category to selected lines for defined layer● copy - Copy selected features● snap - Snap one line to another

New features can be added to existing vector map layer using GRASS ASCII vector format. Feature selection can be done with help of the following options:

● cats - Selection of vector features using category number● ids - Selection of vector features using feature ID's directly

Page 5: GRASS GIS DIGITIZATION TOOLS - cvut.czgeo.fsv.cvut.cz/~landa/publications/2007/italian-gfoss-07/grass-digit.pdfand enhancements in GRASS GUI. In the result, GRASS tools should be available

● coords - Single coordinate pairs can be used too● bbox - Selection of vector features based on bounding box● polygons - Selection of vector features using polygons

3.1 Usage examples

The following figures represents some common tasks in vector editing and sample examples how v.edit can be used.

v.edit map=tmp tool=delete bbox=596926.3125,4920586.6875,603365.8125,4915131

Figure 6: Deleting selected vector features based on the bounding box.

v.edit tool=move map=tmp coords=594273,4919155.6875 move=5000,0v.edit tool=vertex map=tmp coords=599400.75,4918112.25 move=­2000,0

Figure 7: Moving the given vector feature selected by coordinates 5000 units to east and moving line vertex selected by coordinates 2000 units to west.

Introduced examples provide illustration of possible v.edit usage as back-end for the new digitization tool. The GUI-oriented digitization tool formulates needed command using v.edit module and executes it in the background. In the result the module v.edit is designed as low-level tool for editing GRASS vector map layers.

Page 6: GRASS GIS DIGITIZATION TOOLS - cvut.czgeo.fsv.cvut.cz/~landa/publications/2007/italian-gfoss-07/grass-digit.pdfand enhancements in GRASS GUI. In the result, GRASS tools should be available

d.vect map=tmp col=red width=3 ­i cat=`v.edit tool=select map=tmp \ bbox=600921.1875,4926429.9375,601994.4375,4925386.5`

Figure 8: Displaying selected vector features by defined bounding box using d.vect module.

CONCLUSION

Graphical user interface is important issue for GRASS future especially in connection with the newcomers to GRASS. GRASS functionality should be still fully available for the users via CLI. It is user's choice whether to use graphical or command-line interface. GRASS power lies in GIS functionality available more and less via command line interface. GRASS developers are working on several of improvements and enhancements in GRASS GUI. In the result, GRASS tools should be available via CLI and GUI without any limitations.

REFERENCES

[1] Strang, J. - “Programming with curses”, O'Reilly, ISBN 0-937175-02-1[2] Neteler, M., Mitasova, H. - "Open Source GIS: A GRASS GIS Approach”, Springer; 2 edition, ISBN 1402080646