INTERNATIONAL SCIENTIFIC CONFERENCE AND XXIV MEETING OF SERBIAN SURVEYORS ″PROFESSIONAL PRACTICE AND EDUCATION IN GEODESY AND RELATED FIELDS″ 24-26, June 2011, Kladovo - ,,Djerdap“ upon Danube, Serbia.
APPLICATION OF OPEN SOURCE/FREE SOFTWARE (R + GOOGLE EARTH) IN DESIGNING 2D GEODETIC CONTROL NETWORK Milan Kilibarda1, Milutin Pejoviü1 1
University of Belgrade, Faculty of civil engineering, Department of geodesy and geoinformatics, Belgrade, Serbia, E-mail:
[email protected] ;
[email protected]
Summary: A geodetic network design process consists of the design of network geometry and optimal observational plan. Thus, the aim of the network designing is to provide parameters which describe the survey measurements realization necessary to fulfill project requirements. Application of open source/free software (R+Google Earth) in the network design process offers the possibility of calculation and visual presentation of the results. The R software gives possibility to calculate and store results in spatial data format. Spatial data format is possible to be exported in many GIS formats, such as KML. The results in KML format could be represented in the virtual globe Google Earth. The methodology is organized into three segments: 1) the design of network geometry and plan of observables (observational plan) in Google Earth; 2) the calculation of the project parameters based on the network geometry, plan of observables and available equipment standards; and 3) interactive visual presentation of the results in Google Earth. Keywords: Geodetic network design, R ,Google Earth, GIS
1. INTRODUCTION A geodetic control network is the framework of survey stations, with a strictly defined position in relation to the reference coordinate system (CRS). These networks are established for the purpose of topographic surveying, control of supplementary points, for the horizontal and vertical staking out and other dimensional controls on site. The establishment of control networks is the most fundamental operation in any facility construction process and it is a part of the earliest phase of facility construction. Geodetic control network design involves finding the appropriate network geometry (spatial arrangement of stations) and network observational plan (the number, arrangement and the precision of observations). The aim of network designing is to provide parameters which guarantee the fulfillment of project required precision and reliability. During the design of geodetic networks facts such as: constructing accuracy, spatial organization of construction site and terrain configuration, precision of survey equipment, etc., must be taken into account. These circumstances limit the finding of the optimal solution for a geodetic network, not allowing formulaic approach to design problems in geodetic networks. A construction project, that requires centimeter or sub centimeter accuracy, also requires a high precision geodetic control network. In this case, professional and careful approach in geodetic control network design is necessary. The design of a geodetic control network, in terms of accuracy and reliability is based on the application of statistical methods to the observation model. An assumption about the influence of random errors in observation results and their functional dependence on coordinates is described with the mathematical model of observation [8]. Parametric least squares adjustment is the most used technique for adjusting or estimating the coordinates in survey control networks. When performing a parametric least squares adjustment, observations are expressed in terms of unknown parameters that were never observed directly [4]. Product of the least squares solution is a set of statistical statements about the quality of the solution. These statistical statements may take the form of standard errors of the computed coordinates, error ellipses describing the uncertainty of a two-dimensional position in standard errors of observations derived from the computed coordinates and other meaningful statistics [10]. Having completed the adjustment on simulated network geometry and observational plan, the network can be checked for geometrically weak areas, unacceptable error ellipse sizes or shapes, and so on. This inspection may
216
dictate the need for any or all of the following: 1) more observations, 2) different observational procedures, 3) different equipment, 4) more stations, 5) different network geometry, etc. [4]. The design methodology presented in this paper relies on R and Google Earth softwares, and considers a twodimensional control network that involve traditional observations of distances and directions. R is an integrated suite of software facilities for data manipulation, calculation and graphical display and is very much a vehicle for newly developing methods of interactive data analysis [11]. In addition, it has developed rapidly, and has been extended by a large collection of packages (set of functions written for a single piece of data analysis). Google Earth is the geographical browser (virtual globe) that is increasingly popular in the research community and as such, is very suitable for visualization of spatial data. The aim of this work is the automation of a computation process of geodetic networks design in R environment, by using GIS format KML as input and output. This approach offers possibility to create cartographic output of designing results in the virtual globe Google Earth where visualizations are realized in KML files with stored numerical data from project design. This gives the user of the software full control of the process from the start to the end in the visual and intuitive manner where manipulation with text file as input data for network geometry simulation is avoided.
2. R AND GOOGLE EARTH SOFTWARE ENVIRONMENT R environment, a tool for statistical programming is proposed as solution of automated computing, analyzing and process control of data for network design in this paper. Input data for simulated network measurements and visualization of the results of the geodetic network design are provided by using KML as Google Earth spatial data format. 2.1. Renvironment ‘‘R is a system for statistical computation and graphics. It provides, among other things, a programming language, high-level graphics, interfaces to other languages and debugging facilities’’ as defined in the Introduction of the R Language Definition on-line manual [12]. R implements a language similar to the S language. The S language was originally developed by John Chambers, [1]. The main difference is the license. R is free and open source software under the terms of the GNU General Public License. The syntax of the language is similar to C. However, it is a fully functional interpreter that permits the creation of functions and calculations within an environment that is defined by a command line window or graphical user interface [5]. The R is organized as collection of packages. The R packaging system has been one of the key factors of the overall success of the R project [13]. The R contains the base system which allows statistical computation, linear algebra computation, graphics creation and similar. A package is a related set of functions, help files, and data files that have been bundled together. Packages in R are similar to modules in Perl, libraries in C/C++, and classes in Java. The specific packages are not necessary to be installed if it is not a part of the user computing and analyzing interests. R developers have written the R package ″sp″ to extend R with classes and methods for spatial data [7]. Classes specify a structure and define how spatial data are organised and stored. Methods are instances of functions specialised for a particular data class [2]. Another important package used in this research is ″rgdal″ package. This package uses functions of the Geospatial Data Abstraction Library to read and write GIS data with options to handling Coordinate Referent System (CRS). There is an option to define CRS or CRS, which might be obtained directly from the data, and an option to perform transformations among different CRS by using PROJ4 library implemented in ″rgdal″ package. 2.2. Google Earth environment Originally known as EarthViewer, Google Earth was developed by a company called Keyhole Inc. In October 2004 search provider Google acquired Keyhole Inc and in late June of 2005 Google released Google Earth. Google Earth is a three dimensional interactive virtual globe that displays the Earth through a combination of different layers of information. Google Maps and Google Earth have had significant influence in developing of web cartography. Google Earth/Maps is a ground-breaking software in at least five categories: availability of application, high quality background maps, a single coordinate system, web-based data sharing, popular interface and availability of API services [6]. Data format for integration of user’s, additional data in the Google Earth is KML format. All visualization of additional data in Google Earth is controlled by the KML files. KML is XML data format for presentation of information in geographical context. Just as web browsers display HTML files, Earth browsers such as Google
217
Earth display KML files. KML is easy readable programming language uses text and strings. KML has received OGC specification status, that is very important fact for this paper because reading and writing KML files is available in R by ″rgdal″ package. The example of created direction in Google Earth is shown in Figure 1.
Figure 1: Google Earth interface. Figure displays the direction (part of KML file) with elevation profile to check sight lines for ground clearness
3. RESULTS In a geodetic network design, topographic map or aerial photos were used for choosing the possible station positions. This paper presents the possibility of using high resolution imagery in Google Earth for station position choice. In the presented solution, network fixed points have been defined in the Google Earth by adding “x,y” in point description, or just one parameter. The network geometry is stored in the KML format that represents the first input file. The KML is interpreted in the R software. The completed observational plan, all the possible combinations of distance and direction observations are exported to the second input KML file, by using author’s functions. The observational plan could be modified to the desired observations by just erasing directions and distances in Google Earth. Finally, modified observational plan is the input for least squares adjustment process in the control network design. If the network does not have fixed points, or has less than three fixed parameters, it will lead to the least squares adjustment with pseudo-inversion. A stochastic model, necessary for the creation of weighted matrix of observations is added into R function by defining the observational equipment precision for the directions and distances. Figure 2 shows the directions and distances included in the final observational plan. R functionalities allow the transformation of the design input coordinates and measurements simulation derived from Google Earth (WGS84) to the national CRS. It is possible to transform geometry to desired CRS specified by PROJ4 notation. A least square adjustment computation is applied to the final observational plan with the equipment specification. Quality measures for the points and measurements are derived from the adjustment computation, as follow: • Coordinate standard deviation and error ellipse geometry parameters are computed for the unfixed points in the network; and • Internal reliability and marginally detected blunders are computed for measurements. Numerical quality assessment for the points is incorporated into the point coordinates and it is converted to ″sp″ class in R, SpatialPointsDataFrame. SpatialPointsDataFrame contains four slots, containers for data that fully determine the data in a spatial way. Project4string slot defines CRS, bbox – boundary box, coords – all coordinates of points, coords.nrs – records the column positions where in the data the coordinates were taken
218
from (just in case when a spatial class is derived from data frame, the data frame is the most popular data format in R).
Figure 2: The directions and distances included in final survey plan. Directions are colored in red and distances in yellow Points’ attributes, the numerical quality assessment of the points, in this case, are stored in the remaining SpatialPointsDataFrame slot named data. SpatialPointsDataFrame could be exported to many GIS format by using R package ″rgdal″. Spatial class, SpatialLinesDataFrame and SpatialPolygonesDataFrame also used in this research have similar properties.
Figure 3: Schematic representation of SpatialPointsDataFrame class [6] Observations with quality parameters are adopted to SpatialLinesDataFrame. Error ellipses geometry in desired scale with other quality measures of points as attributes is created by authors’ function. This is the class of SpatialPolygonsDataFrame. Thus, all results of the adjustment are possible to be converted to many GIS formats in desired CRS. KML, as a popular format for the geographic visualization on virtual globes, was a choice in this case. Besides the visualization of the geometry, numerical results of adjustment are stored in KML. Numerical results are available by clicking on the points, ellipses and lines in Google Earth.
219
Figure 4: Results of network adjustment in Google Earth KML format. Error ellipses are in scale 10 000:1
4. CONCLUSIONS Linear algebra computation and statistical computation provided by base R installation offers possibility for an easy least square adjustment computation in the geodetic network. The possibility for exporting and importing different data formats in R allows classical approach to this problem, making both input data and output reports in text data format. In this paper a solution where input data are in the GIS format and the output is generated as desired GIS format is presented. This approach enables elegant and intuitive way of controlling the network design process from the beginning to the end. In this work the functions and routines in R for the two-dimensional (2D) geodetic control network design, that involve observations of distances and directions, are created. Future work will contain solutions for onedimensional (1D) geodetic control network designs. The least squares adjustment of real survey observation for 1D and 2D geodetic networks should be done as separate set of functions in R and together with the functions for the deformation analysis of engineering structures would become a useful geodetic package.
AKNOWLEDGEMENTS This work was supported by the Ministry of Science of the Republic of Serbia (Contracts No. TR36035 and TR 36009).
REFERENCES [1] Becker, R.A, Chambers, J.M., (1984). S: An Interactive Environment for Data Analysis and Graphics. Wadsworth, Belmont, CA, 550pp. [2] Bivand, R. S., Pebesma, E. J., Gomez-Rubio, V., ( 2008). Applied Spatial Data Analysis with R. Springer , New York [3] CRAN, (2011). The Comprehensive R Network, http://cran.r–project.org. [4] Ghilani, D., Wolf, P. (2006). Adjustment computations - Spatial Data Analysis. John Wiley&Sons. New Jersey [5] Grunsky, E.C. (2001). R: a data analysis and statistical programming environment– an emerging tool for the geosciences. Computers & Geosciences 28 (2002) 1219–1222
220
[6] Hengl, T. (2009). A Practical Guide to Geostatistatistical Mapping. Office for Official Publications of the European Communities, Luxembourg, p.270 [7] Pebesma, E. J. and Bivand, R. S. (2005). Classes and methods for spatial data in R. R News, 5(2):9–13. [8] Peroviü, G. (2005) Metod najmanjih kvadrata. Faculty of civil engineering, University of Belgrade. Belgrade. [9] R Development Core Team (2008). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-07-0. [10] Schofield, W., Breach, M. (2007). Engineering Surveying. Elsevier, Ltd. London. [11] Venables. W.N.; Smith. D.M. (2010). Introduction to R. R Development Core Team. [12] http://stat.ethz.ch/R-alpha/Rrelease/doc/manual/R-lang.html [13] http://cran.r-project.org/doc/manuals/R-intro.pdf
221