The GNU GaMa Project – Adjustment of Geodetic Networks

This paper reports on the GaMa Free Software project for adjusting of geodetic networks, which has been started at the department of mapping and cartography of the Faculty of Civil Engineering, CTU Prague. The GaMa project received the status of GNU software [3] in 2001, and in this paper we would like to talk about our positive experience of the attractiveness of the idea of Free Software (and namely the GNU project [1]) for talented students, and how it can help to stimulate and support their creative work, international contacts and professional growth. Free Software has much in common with the spirit of university education (most of all, the tradition of free sharing of information). For this reason we start our introduction to the GaMa project with a description of its evolvement against the background of the activities of Commision 2 for Professional Education of FIG (International Federation of Surveyors) and its Virtual Academy working group. The discussions and projects presented at the FIG workshop and seminar in Helsinki [14] in 2001 show that the Virtual Academy is mainly associated with the exploitation of technical facilities and communication tools (provided by the Internet today), and most of the current FIG projects in the field of internet education are oriented more or less toward mass education on the bachelor or master level. Perhaps due to our different background (our country is still in a transitional period), we put more emphasis on our PhD programs and the idea of the Virtual Academy is particularly attractive to us as a way of building professional international contacts and collaboration. Our PhD students will be responsible for our future development, as they will be the source of our future academic staff. Ways of limiting time consuming and routine tasks like testing students’ knowledge are undoubtedly attractive, and deserve extensive support and development. Yet however fascinating present technologies may be, they lack the maturity of traditional educational tools and courses. Technically speaking, we have systems and educational programs today that are capable of serving an almost unlimited number of students. Does this mean the end of most of traditional universities, and are they going to be replaced by virtual universities equipped with sufficiently powerful hardware and sophisticated educational programs? Surely not, because the distinction of a university reflects above all the quality of its people, while its equipment is always a secondary element. We are convinced that when thinking about the Virtual Academy and about education in general, more emphasis should be put on human communication and collaboration than on technical facilities. In this sense the best inspiration for the Virtual Academy is provided by successful Free Software projects like GNU and many others.

This paper reports on the GaMa Free Software project for adjusting of geodetic networks, which has been started at the department of mapping and cartography of the Faculty of Civil Engineering, CTU Prague. The GaMa project received the status of GNU software [3] in 2001, and in this paper we would like to talk about our positive experience of the attractiveness of the idea of Free Software (and namely the GNU project [1]) for talented students, and how it can help to stimulate and support their creative work, international contacts and professional growth.
Free Software has much in common with the spirit of university education (most of all, the tradition of free sharing of information). For this reason we start our introduction to the GaMa project with a description of its evolvement against the background of the activities of Commision 2 for Professional Education of FIG (International Federation of Surveyors) and its Virtual Academy working group.
The discussions and projects presented at the FIG workshop and seminar in Helsinki [14] in 2001 show that the Virtual Academy is mainly associated with the exploitation of technical facilities and communication tools (provided by the Internet today), and most of the current FIG projects in the field of internet education are oriented more or less toward mass education on the bachelor or master level.
Perhaps due to our different background (our country is still in a transitional period), we put more emphasis on our PhD programs and the idea of the Virtual Academy is particularly attractive to us as a way of building professional international contacts and collaboration. Our PhD students will be responsible for our future development, as they will be the source of our future academic staff.
Ways of limiting time consuming and routine tasks like testing students' knowledge are undoubtedly attractive, and deserve extensive support and development. Yet however fascinating present technologies may be, they lack the maturity of traditional educational tools and courses. Technically speaking, we have systems and educational programs today that are capable of serving an almost unlimited number of students. Does this mean the end of most of traditional universities, and are they going to be replaced by virtual universities equipped with sufficiently powerful hardware and sophisticated educational programs? Surely not, because the distinction of a university reflects above all the quality of its people, while its equipment is always a secondary element.
We are convinced that when thinking about the Virtual Academy and about education in general, more emphasis should be put on human communication and collaboration than on technical facilities. In this sense the best inspiration for the Virtual Academy is provided by successful Free Software projects like GNU and many others.

About GNU GaMa
The GaMa project (the acronym comes from Geodesy and Mapping) provides free software written in C++, released under the terms of the GNU General Public Licence [2], aimed at adjusting geodetic networks http://www.gnu.org/software/gama/. The project was started by Aleš Čepek in 1998, but soon his first students joined the project. The original idea was to start a project to demonstrate to students the capability and power of object programming and at the same time to present and conserve practical experience and knowledge gained in previous years at the Research Institute for Geodesy (VÚGTK Zdiby) [11].
The GaMa project has been strongly influenced by the work of František Charamza, namely his research in the field of applying Gram-Schmidt orthogonalisation as a general numerical adjustment method (the GSO algorithm). Without going into detail, we can say that GSO is an orthogonalisation algorithm that solves the adjustment without normal equations, directly from the project equations, and thus avoids possible numerical problems in the case of ill-conditioned systems (the condition number of a normal equations matrix is the square of the condition number of a design matrix). The GaMa project uses the Singular Value Decomposition algorithm (SVD) for numerical solution of the adjustment, but GSO is also available as an alternative. Thanks to its object-oriented design, GaMa can easily adopt other numerical methods, like Cholesky decomposition of normal equations or numerical solutions exploiting the sparse structure of the 26 design matrix (however, in our current plans these enhancements have low priority).
Originally the project was not expected to be presented outside our faculty, so everything was done in Czech, from the C++ names to the documentation. This version of the program allowed only uncorrelated horizontal directions and distances in the local triangulation network to be adjusted. The project was first introduced to a wider public at the FIG Working Week 2000 [13]. Professor Henrik Haggrén (from HUT Findland [12]) proposed that the GaMa project be presented in 2001 at the Workshop and Seminar in Helsinki and we then started working on adapting GaMa for application outside the local community of Czech users. Two major changes had to be made l redefinition of Czech tags in the XML input data into their English equivalents, and l implementation of new observation data structures to enable general adjustment of correlated observations.
In this second point, we benefitted from discussions with Henrik Haggrén and from his interest in possible future enhancements to enable adjustment of photogrammetric observations together with classical observation types.
The design of the data structures is the cornerstone of any software project. To implement a new observation type in our project, it is only necessary to derive the new corresponding class and to define in it a few virtual functions. The design of GaMa classes enables implementation of adjustment of any information with a given variance-covariance matrix that can be linearized in respect to the coordinates and other unknown parameters.
The GaMa project uses the concept of clusters to handle possibly correlated observations of a general kind. In C++ terminology a cluster is a container class that maintains a set of observations with a common variance-covariance matrix (symmetric, band or diagonal), as depicted in Fig. 1. Observations are independent of point data which, in the current version, is defined only for a local geodetic network (an adjustment model on the ellipsoid is our next planned goal). Observation data structures have been designed to enable easy implementation of sparse matrix algorithms in the network adjustment for future versions. Currently, the following observation types are supported l horizontal directions and distances, l horizontal angles, l slope distances and zenith angles, l height differences, l observed coordinates (used in sequential adjustment, etc.,) and l observed coordinate differences (vectors).
In order to add a new observation type to the project it is necessary to override the virtual functions for linearization by an actual code for that observation type, and thus to derive the appropriate class from the Cluster. In this way, for example, photogrammetric measurements can be incorporated and simultaneously adjusted together with classical surveying observables in a common three dimensional network.
In parallel with the above mentioned changes we have worked on other enhancements and improvements necessary for making GaMa into GNU software [3]. We passed the GNU review process and in November 2001 GaMa was declared a GNU package.
The status of GNU software for the GaMa project is not only amatter of prestige: it also provides extensive technical support from the GNU web space and archives to the CVS repository, know-how background for project policies and legal advice. Last but not least, the status of GNU software will help us to involve more students and developers in the project.

Using XML as a data format
The primary motivation for usage of Extensible Markup Language (XML) in the GaMa project was to define structured input data for adjusting the local geodetic network. Extensible Markup Language [7] describes a class of data objects called XML documents, and is generally expected to be one of the most important communication standards in the near future. The data is described (similarly to HTML) with a set of XML user defined markup tags. The most important feature of XML is probably the ease of defining a grammar for our data (a class of XML documents) and thus we can validate it even independently of our application. This grammar is known as a document type definition, or DTD.
The document type definition for GaMa XML input data format is http://www.gnu.org/software/gama/gama-xml.dtd DTD is not the only possible schema for defining XML syntax and generally not even the best schema. However, it is quite sufficient for the relatively simple syntax of GaMa input, as shown in the following short (but complete) example (see Fig. 2).
Most of this example can surely be understood intuitively without bothering about the syntax, whereas formal parsing XML is not a trivial task. Without going into technical details, let us just note that GaMa uses the expat parser [8] version 1.1, written by James Clark.

Rocinante
XML is a replacement for ASCII data files, and can be viewed or edited with a text editor or simply printed. Many tools are available for XML processing, e.g., viewing or transforming it into HTML or even editing. However, a typical user would never edit XML input manually as a raw text file.
The GaMa project originally focused on developing a platform independent C++ library (GaMaLib) with only a simple command line tool (gama program) for processing XML input data. Our primary platform is GNU/Linux, and to help our users to use GaMa adjustment we have been running a mail-server and a web interface (WebGaMa) based on the PHP scripting language.
In 2001, Jan Pytel (a student from our faculty) decided to write a graphical user interface (GUI) for GaMa based on the Qt graphical library [10]. The first beta versions of his program Rocinante [6] became available in November 2001. Rocinante now forms part of the GaMa project, and an example screen-shot is shown in Fig. 3.
It should be stressed that Rocinante is a platform independent GUI; the Qt library is available on Linux, MS Windows and MacOs, among others. The Qt C++ library is one of the best graphical libraries available, for example, it is used in Linux KDE or Borland Kylix, and for Linux it is available free of of charge under the GPL licence. Rocinante provides a model example of how students can be involved and can actively contribute to a project, simply for the joy of doing good work and supporting the idea of Free Software.

Future plans
To conclude our paper we summarise what is still missing in the GNU GaMa project, what has to be done, and our plans for future development.
l We have prepared a project to produce outputs in any language that can be expressed in the UTF-8 encoding (Unicode). Technically, this is done by separating all texts into XML files, with possibly different input encodings, from which the corresponding C++ functions for dynamic language switching and UTF-8 strings are generated. This could form the basis for an international student project (participants need not be programmers).
l Naturally, adjustment results should also be available in XML format, like the input data. One of our plans is to enable adjustment in steps using earlier adjustment results. This point was deliberately postponed until we decide whether to define an ad hoc GaMa XML adjustment output format or to use a more general scheme inspired by the Borland XML general data packets.
l Another goal of our project is to gather a collection of model geodetic networks and to present them with their adjustment results on the web. XML is the best tool for this purpose. Lack of reliable model data for debugging and testing (namely in the case of 3D networks) was a problem that we had to cope with. Typically examples given in textbooks on geodetic adjustment and least squares are trivial, and are useful only for demonstration purposes. They cannot be used in software development.
l This year we plan to add to Rocinante a plug-in for graphical output described in Scalable Vector Graphics (SVG) [9], a general graphical format based on XML.
l Closely related to GaMa is another project of ours aimed at processing levelling observations, namely the project for a general XML format for describing levelling data from various recording units. l A major enhancement planned for GaMa is the implementation of adjustment in a global coordinate system together with classes for handling cartographic projections (that could be added as plug-ins). Discussions during the FIG congress [15] with Frank Leahy from Melbourne University about his experience and work helped us to clarify the choice of a geocentric reference frame to be used in the GaMa adjustment model. The GaMa project is a GNU software. Anybody can use and redistribute it freely, and all source codes are available under the GPL licence. Furthermore, it is platform independent and currently runs on GNU/Linux and on Microsoft Windows (we are looking for a volunteer to port it to the MacOs operating system).
Starting this year, we have included GNU GaMa/Rocinante in one of our undergraduate courses, in which our students are introduced to the basic geodetic software used at our faculty. At the current stage, Rocinante is ready to be used in areas from basic surveying computations (intersections, traverses, etc.) to the adjustment of special measurements of 3D networks in engineering geodesy.