AP02_3.vp 1 Software freedom as an academic motivator 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 attrac- tiveness of the idea of Free Software (and namely the GNU project [1]) for talented students, and how it can help to stim- ulate and support their creative work, international contacts and professional growth. Free Software has much in common with the spirit of uni- versity 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 work- shop 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 matu- rity 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 uni- versities 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 Soft- ware projects like GNU and many others. 2 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 equa- tions, 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 ob- ject-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 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 42 No. 3/2002 The GNU GaMa Project – Adjustment of Geodetic Networks A. Čepek The development of Free Software is a well established and successful phenomenon which could hardly exist without the Internet, where groups of programmers scattered all around the world are developing software. The idea of Free Software is highly attractive to talented creative students and can stimulate and support their profesional activities. The GNU GaMa [4] for adjusting of geodetic networks, with input data described in XML, is given here as a concrete example. Free Software [3] (or Open Source) projects need not be limited to software development but can generally cover any professional project based on free information exchange; a suggested example is the planned collection of model geodetic networks described in XML. Keywords: GNU GaMa, geodetic network adjustment, free software. design matrix (however, in our current plans these enhance- ments 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 applica- tion outside the local community of Czech users. Two major changes had to be made � redefinition of Czech tags in the XML input data into their English equivalents, and � implementation of new observation data structures to en- able 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 ob- servations 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. Observa- tions 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 net- work adjustment for future versions. Currently, the following observation types are supported � horizontal directions and distances, � horizontal angles, � slope distances and zenith angles, � height differences, � observed coordinates (used in sequential adjustment, etc.,) and � observed coordinate differences (vectors). In order to add a new observation type to the project it is necessary to override the virtual functions for lineariza- tion 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 clas- sical 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 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 27 Acta Polytechnica Vol. 42 No. 3/2002 Fig. 1: Basic observation data structures 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. 3 Using XML as a data format The primary motivation for usage of Extensible Markup Language (XML) in the GaMa project was to define struc- tured 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 defin- ing 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. 4 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 trans- forming 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 run- ning a mail-server and a web interface (WebGaMa) based on the PHP scripting language. We considered the possibility of presenting our adjust- ment as a web-based application implemented with C++ CGI scripts, but this proved to be impractical and for various reasons we did not want use the Java language. As most of our potential users come from the Microsoft Windows platform, we provided a windows application (GaMaWed) built with the Borland C++ Builder. Actually, we wanted to be prepared in advance for the case when Inprise/Borland would port 28 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 42 No. 3/2002 Fig. 2: Example of GaMa input their C++ Builder to Linux; but until now only Kylix is avail- able. However, none of these solutions was satisfactory. 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 pro- gram Rocinante [6] became available in November 2001. Rocinante now forms part of the GaMa project, and an exam- ple screen-shot is shown in Fig. 3. It should be stressed that Rocinante is a platform in- dependent 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. 5 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. � 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). � 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. � 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 text- books on geodetic adjustment and least squares are trivial, and are useful only for demonstration purposes. They cannot be used in software development. � This year we plan to add to Rocinante a plug-in for graphi- cal output described in Scalable Vector Graphics (SVG) [9], a general graphical format based on XML. � 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. © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 29 Acta Polytechnica Vol. 42 No. 3/2002 Fig. 3: Rocinante the Qt based GUI for GNU GaMa � A major enhancement planned for GaMa is the implemen- tation 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 Univer- sity 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 inde- pendent 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/Rocin- ante 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 (inter- sections, traverses, etc.) to the adjustment of special measure- ments of 3D networks in engineering geodesy. Acknowledment Support of the Ministry of Education, Youth and Sports of the Czech Republic, project MSM: 210000007, is highly appreciated. References [1] Free Software Foundation, Inc.: GNU’s Not Unix! [on- line]. FSF, Boston, MA, USA [cit. 2002-07-13]. Updated 2002-07-01 . [2] Free Software Foundation, Inc.: GNU General Public Li- cense [online]. [cit. 2002-07-13]. Updated 2001-07-15 . [3] Free Software Foundation, Inc.: Categories of Free and Non-Free Software [online]. [cit. 2002-07-13]. Updated 2002-03-09 . [4] Free Software Foundation, Inc.: GNU GaMa [online]. [cit. 2002-07-13]. Updated 2002-06-03 . [5] Free Software Foundation, Inc.: GNU GaMa DTD [on- line]. Version 2.0.10. [cit. 2002-07-13]. Updated 2002-05-04 . [6] Free Software Foundation, Inc.: GNU GaMa / Rocinante [online]. [cit. 2002-07-13]. . [7] World Wide Web Consortium (W3C): Extensible Markup Language (XML) 1.0. (Second Edition) 6 Oct. 2000 [on- line]. [cit. 2002-07-13] . [8] CLARK, James: expat – XML Parser Toolkit [online]. [cit. 2002-07-13] . [9] World Wide Web Consortium (W3C): Scalable Vector Graphics (SVG) 1.0 specification [online]. [cit. 2002-07-13]. 04 Sept. 2001 . [10] Trolltech, A. S: Trolltech [online]. [cit. 2002-07-13] . [11] Výzkumný ústav geodetický, topografický a kartografic- ký ve Zdibech: VÚGTK – úvodní stránka [online]. [cit. 2002-07-13]. Aktualizováno 29. 4. 2002 . [12] Helsinki University of Technology: Teknillinen Korkea- koulu – TKK [online]. [cit. 2002-07-13] . [13] Čepek, A., Hnojil, J.: Internet in Education, Practical Expe- rience and Future Plans. FIG Working Week 2000, May 21–26, Prague 2000. [14] Čepek, A.: Free open source project GaMa for adjustment of local geodetic networks. FIG Workshop and Seminar: Vir- tual Academy, June 5–8, 2001, Helsinki University of Technology, Lifelong Learning Institute Dipoli. [15] Čepek, A., Pytel, J.: Free Software � An Inspiration for Virtual Academy. XXII FIG International Congress and ACSM�ASPRS Conference and Technology Exhibition 2002, April 19–26, 2002, Washington, DC, U.S.A. [16] Leahy, F. J.: The Automatic segmenting and Sequential Phas- ed Adjustment of Large Geodetic Networks. (Dissertation), University of Melbourne, 1999. Doc. Ing. Aleš Čepek, CSc. phone: +420 224 354 657 fax: + 420 224 355 419 e-mail: cepek@fsv.cvut.cz Web site: http://gama.fsv.cvut.cz/~cepek Dept. of Mapping and Cartography Czech Technical University in Prague Faculty of Civil Engineering Thákurova 7 166 29 Prague, Czech Republic 30 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 42 No. 3/2002