Trans GK U UTM WGS84
Trans GK U UTM WGS84
Trans GK U UTM WGS84
Abstract: The physical surface of the earth has irregular shape which is not
mathematically defined, therefore the shape of the Earth is approximated with
mathematically defined surfaces such as ellipsoid and sphere. The developing of a
global positioning systems, thus and modern navigation systems, as effect produce
large amounts of data which contain the problem of homogeneity. This problem
could be exceed if all the data are store in the same coordinate system. Hence the
need for data transformation from local coordinate systems to the global coordinate
systems. Global level implies WGS84 ellipsoid and UTM projection while national
coordinate system of Republic Serbia is Gauss-Kruger with Bessel ellipsoid. This
coordinate system of Republic Serbia on a global level has a local character.
Applying appropriate mathematical models and functions it is possible to transform
coordinates from one system to another and vice versa. The paper describes
coordinate transformations from Gauss-Kruger coordinate system ellipsoid Bessel
to UTM projection WGS84 ellipsoid and vice versa, and also an application which
provides transformation of its kind that is made using open source environment.
Name of the application is TRANS7_GK_UTM_GK and it can be found and used
on the web page of the faculty for Mining and Geology under the link
http://gk2utm.rgf.bg.ac.rs with a user guide.
Keywords: Gauss-Kruger, Besell, WGS84, UTM, coordinate transformation, r
1
University of Belgrade – Faculty of Mining and Geology, Đušina 7, 11000 Belgrade, Serbia
emails: [email protected]; [email protected]; [email protected]
30 Gojković Z., Radojičić M., Vulović N.
projekcijom. Primenom odgovarajućih matematičkih modela i funkcija mogu se
transformisati koordinate iz jednog sistema u drugi. U ovom radu prikazan je
postupak transformacije iz jednog sistema u drugi, a i aplikacija koja omogućava
transformaciju ovakve vrste koja je napravljena pomoću alata i softvera otvorenog
koda pod nazivom TRANS7_GK-UTM-GK i dostupna na web adresi Rudarsko-
geološkog fakulteta na linku http://gk2utm.rgf.bg.ac.rs sa uputstvom za upotrebu.
Ključne reči: Gaus-Kriger, Beselov elipsoid, WGS84, UTM, transformacija
koordinata, r
1. INTRODUCTION
National networks and related data can be found in national projections which can be
divided into zones, Also within a state, data can be located into different coordinate
systems. EPSG (European Petroleum Survey Group – Oil & Gas Producers) has started
collecting geodetic parameters since 1986th which are aviable on the web address
http://www.epsg-registry.org/. This data set allows simple transformations between
different coordinate systems, constantly evolving, progressing and updated.
Transformation leads to the data homogenization and it is therefore necessary to be done
coordinate transformation between different systems. The paper describes coordinate
transformations from Gauss-Kruger coordinate system ellipsoid Bessel to UTM
projection WGS84 ellipsoid and vice versa, and also algorithm which can be used in „r“
open source software. Using the software package „shiny“ within „r“ software,
TRANS7_GK-UTM-GK application is make to be used for users who don’t need to
know programming. Application TRANS7_GK_UTM_GK can be found and used on
the web page of the faculty for Mining and Geology under the link
http://gk2utm.rgf.bg.ac.rs with a user guide.
Mathematically caused construction of the grid of meridians and parallels that serves as
the mathematical basis for representation of the Earth's surface in the plane and for
making maps is called a map projection. Position of the point is usually defined with
geographical coordinates, latitude and longitude (φ,λ), and it’s projection on the plane
with cartesian coordinates (X,Y). Between (φ,λ) and (X,Y) exists a mathematical
relation determined by choice of map projection, which corresponds to (Jovanović,
1983):
x=function1(lat,lon)=f1(φ,λ) у=function2(lat,lon)=g1(φ,λ)
Application for coordinate transformation … 31
Projection has called Gauss-Kruger because the theory concept had been developed by
Gauss, and practical concept had done by Kruger on 1912th (Kruger 1912).
3. COORDINATE TRANSFORMATION
2. First eccentricity:
E 8. Radius of the curvature –
e ,
a parallel
R N cos B ,
3. Second eccentricity
E B – geodetic latitude,
e ,
b L – geodetic longitude,
4. Flattening
a b 9. Third ellipsoidal flattening
f ,
a ab
n ,
ab
5. Radius of the curvature –
poles o – geodetic length of the
prime meridian (o =21о ),
a2
c ,
b 10. Radius of the curvature –
prime vertical:
6. Radius of the curvature – a
No ,
meridian 1 e sin 2 Bo
2
a 1 e2
M ,
1 e2 sin 2 B
3 Auxiliary values:
Y K X
Y ; X ; ( К 7 500 000, m0 0.9999) (1)
0,9999 0,9999
to
B Bo (1 o 2 ) y 2
2 No2
to
(5 3to 2 6o 2 6to 2o 2 3o 4 9to 2o 4 ) y 4
24 N o 4
(2)
to
6
(61 90to 2 45to 4 107o 2 162to 2o 2 45to 4o 2 ) y 6
720 N o
to
8
(1385 3633to 2 4095to 4 1575to 6 ) y 8 ...
40320 N o
1 1
L Lo y 3
(1 2to 2 o 2 ) y 3
N o cos Bo 6 N o cos Bo
1
(5 28to 2 24to 4 6o 2 8to 2o 2 ) y 5 (3)
120 N o5 cos Bo
1
(61 662to 2 1320to 4 720to 6 ) y 7 ...
5040 N o 7 cos Bo
Where:
x 2x 4x 6x 8x
Bo sin sin sin sin ... (4)
ab 1 1
(1 n2 n4 ...) (5)
2 4 64
3 27 3 69 5
n n n ... (6)
2 32 512
21 2 55 4
n n ... (7)
16 32
34 Gojković Z., Radojičić M., Vulović N.
151 3 417 5
n n ... (8)
96 128
1097 4
n ... (9)
512
z N 1 e2 h sin B (12)
Where:
a2
N
a 2 cos 2 B b 2 sin 2 B
x 1 z y x t x
y
(1 k ) z 1 x y t y (13)
z WGS y x 1 z Bessel t z
Step five: Transformation of rectangular coordinates on the WGS84 ellipsoid into the
geographical coordinates on the WGS84 ellipsoid ((X, Y, Z)WGS84 -(B, L)WGS84),
y
arctan rad (14)
x
z
Bo arctan (15)
D 1 e2
a
Ni i 0,1, 2... (16)
1 e sin 2 Bi
2
D
hi Ni i 0,1, 2... (17)
cos Bi
1
z Ni
i arctan 1 e2 i 0,1, 2... (18)
D Ni hi
D x2 y 2 (19)
It should be noted that this is an iterative process where iteration process ends when the
geodetic latitude from the two successive iterations have the same values.
Step six: Transformation of the geographical coordinates on the WGS84 ellipsoid into
rectangular coordinates UTM projection.
Coefficients:
ab 1 2 1 4
1 n n ... , (21)
2 4 64
3 9 3 3 5
n n n ... , (22)
2 16 32
36 Gojković Z., Radojičić M., Vulović N.
15 2 15 4
n n ... (23)
16 32
35 3 105 5
n n ... , (24)
48 256
315 4
n ... , (25)
512
ab
n , (26)
ab
Ni cos 4 Bes 5 t 2 9 2 4 l 4
t t
xX N i cos 2 Bes l 2
2 24
N i cos6 Bes 61 58t 2 t 4 270 2 330t 2 2 l 6
t
(27)
270
N i cos8 Bes 1385 3111t 2 543t 4 t 6 l 8 ...
t
40320
Where:
̅
Х = G(B) (28)
Ni cos3 Bes 1 t 2 2 l 3
1
y Ni cos Bes l
6
Ni cos5 Bes 5 18t 2 t 4 14 2 58t 2 2 l 5 (29)
1
120
Ni cos7 Bes 61 479t 2 179t 4 t 6 l 7 ...
1
5040
l 0 (31)
x N x m (32)
y E y m 500000 (33)
( E 500000) N
y' ; x' (35)
m m
Should be used all equations from the previous step six above.
̅,Х
Step seven: Transformation from (У ̅)GK into modulated (У,Х) GK,
„r“ is an open source software and programming language available at web adress
https://cran.r-project.org/, where it can be downloaded and used freely. „r“ is an
integrated suite of software facilities for data manipulation, calculations and graphical
display. Also „r“ is programming language that provides interface to other programming
languages, as well as ready-made algorithms in many areas. It can be said that „r“ is an
38 Gojković Z., Radojičić M., Vulović N.
evolution of „s“ language created by Bell laboratory. At the moment „r“ have a 29
standard packages and 9987 packages available in library which can be added (Cran.r-
project.org, 2017).
„Shiny“ is a package witin the „r“ open source software that makes easy to build
interactive web applications. Shiny features works in the r environment and the main
goal is that users do not need to know „r“ (Shiny.rstudio.com, 2017).
Architecture of the „Shiny“ application consists two components:
1. User interface (ui.r) component - is „r“ script file which control the
appearance and content of the application. It must be defined in the source
script file with name ui.r.
2. Server component (server.r) is an engine of the application, and contains all
the necessary instructions for the proper functioning of the application. Also
should be defined in the source script file under the name server.r.
Besides „Shiny“ package also have been used „rgdal“ and „sp“ package. „rgdal“ package
allows importing of vector and raster data into „r“, which can be easily converted to
spatial data (Cran.r-project.org, 2016).
Many packages within the „r“ contained own presentations of the spatial data, what
caused problems in the data exchange between other „r“ packages and external
applications. With this package „r“ is more coherent for analyzing different types of
spatial data, and data conversion to external applications is very simple (Cran.r-
project.org, 2016).
Ui.r and server.r script file can be found on the web page of the Underground Mining
Engineering Journal.
Staring application
Every „Shiny“ application have same structure: two r script files saved into same folder
with names ui.r and sarver.r. Aplication can be started through the button „runApp“ that
will appear when in the Rstudio are open these two files (Figure 1). Starting the
application on the „runApp“ button, application will be shown into Rstudio or web
browser (Figure 2).
Application for coordinate transformation … 39
ui.r component
shinyUI(fluidPage( )) – represent code which is minimum to be created „Shiny“
application. Result is an empty application with an empty user interface.
„Shiny“ ui.r script file use function fluidpage to create display which can be adjusted
automatically. Figure 3 shows script file for making user interface. Besides those
contents it is also important to provide location for output data.
„Shiny“ contains prebuilt widgets where every widget represent „r“ function. Most used
widgets are counters, buttons etc which can be easily added into main or another panel.
Every widget requires few arguments where main arguments are name and label.
server.r component
Placing widgets into ui.r script file provides interactive content into user interface where
users can process their data. Next step is to build output data which can be downloaded
by the user. This can be done with r code saved into the script file server.r. „Shiny“
Application for coordinate transformation … 41
contains lot of different widgets which transform r objects into the output data and
sending them to the user (Figure 4).
Figure 9 shows output file into csv format downloaded by user and opened into Microsoft
Excel. Columns represents respectively:
1. V1 –point name,
2. V4 – height,
3. E – easting (Y),
4. N – northing (X).
It should be noted that the starting screen contain picture how it should be prepared input
csv file.
5. CONCLUSION
This kind of transformations includes three translations, three rotations and changing
scale. GIS software’s very often use simplified transformation models which are in some
cases good enough for certain purposes. Selection of the coordinate system is one of the
first steps in establishing GIS and it should be done with particular attention, because
well planned and adequately adopted projection is a base for establishing GIS. This paper
shows all equations for coordinate transformation from Gauss-Kruger into UTM and
vice versa. Due to the large number of the equations and the length of the whole process
best way for visualizing and use was to make single interactive application. Such
application has made in the „r“ software using package „Shiny“ and it can be found on
the web site of the Faculty for Mining and Geology under the url gk2utm.rgf.bg.ac.rs.
REFERENCES
CRAN.R-PROJECT.ORG (2016) Package ‘rgdal’ [Online] Cran.r-project.org.
Available from: https://cran.r-project.org/web/packages/rgdal/rgdal.pdf [Accessed:
11.12.2016.].