Trans GK U UTM WGS84

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

UNDERGROUND MINING ENGINEERING 30 (2017) 29-45 UDK 62

UNIVERSITY OF BELGRADE - FACULTY OF MINING AND GEOLOGY YU ISSN 03542904

Original scientific paper

APLICATION FOR COORDINATE TRANSFOMATION BETWEEN


GAUS - KRUGER PROJECTION - BESSEL ELLIPSOID AND UTM
PROJECTION - WGS84 ELLIPSOID
APLIKACIJA ZA TRANSFORMACIJU KOORDINATA IZMEĐU
GAUS - KRIGEROVE PROJEKCIJE - ELIPSOID BESELA I UTM
PROJEKCIJE - WGS84 ELIPSOID
Gojković Zoran 1, Radojičić Marija1, Vulović Nikola1

Received: March 12, 2017 Accepted: May 8, 2017

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

Apstrakt: Fizička površ Zemlje je nepravilnog oblika koja matematički nije


definisana zbog čega se oblik Zemlje aproksimira matematički definisanim
površima kao što su elipsoid i sfera. Razvojem globalnih sistema za pozicioniranje,
samim tim i sistema za navigaciju, za posledicu imamo ogromne količine podataka
kod kojih se javlja i problem homogenosti u geoprostornom smislu. Ovaj problem
može se prevazići ako bi se svi podaci nalazili u istom koordinatnom sistemu.
Odatle i potreba da se podaci iz lokalnih (državnih) koordinatnih sistema
transformišu u koordinatne sisteme koji su zastupljeni na globalnom (svetskom)
nivou. U svetu je zastupljen elipsoid WGS84 i UTM projekcija, dok je državni
koordinatni sistem Republike Srbije, koji posmatrano na globalnom nivou ima
ulogu lokalnog karaktera, smešten na elipsoid Besela sa Gaus-Krigerovom

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.

2. GAUSS-KRUGER PROJECTION AND UTM PROJECTION

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

Table 1: Ellipsoid parameters (Wikipedia, 2012)


Elipsoid Major radius (a) Semi-minor axis (b) Inverse flattening (1/f)
WGS 84 6 378 137.0m ≈ 6 356 752.314 245m 298.257 223 563
Bessel (1841) 6 377 397.155m 6 356 078.963m 299.1528153513233

2.1. Gauss-Kruger projection

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).

Gauss-Kruger projection is a traverse conformal projection on which the narrow


meridian zones of the ellipsoid are mapped to the plane. In this projection central
meridian is mapped as a straight line (X – axis of the rectangular coordinate system)
while the scale on the central meridian should remain constant and equal to one.
National coordinate system implies Gauss-Kruger projection with Bessel ellipsoid
(Table 1) and Hermannskogel datum. The largest part of the surface of the Republic of
Serbia is mapped to a projection plane for whose x-axis has been taken projection of the
21° (longitude) meridian east from Greenwich and the width of the zone 3°. Y-axis
represent equator projected on the plane.

2.2. UTM projection

The Universal Transverse Mercator (UTM) is modified Gauss-Kruger projection. With


this projection it has been achieved conditions that all Earth surface can be represented
with one coordinate system with limitation within polar areas where has adopted
Universal Polar Stereographic projection (UPS). The width of the zones is 6o and whole
world has divided into sixty zones.
All formulas for mathematical explanation into Gauss-Kruger projection are valid and
for UTM projection with change into scale along the central meridian which is equal to
0.9996 and y-axis starts with 500000 instead of 7500000.
32 Gojković Z., Radojičić M., Vulović N.

3. COORDINATE TRANSFORMATION

3.1. Transformation from Gauss-Kruger into UTM projection

Parameters (Radojčić, 2008):

1. Linear eccentricity 7. Radius of the curvature –


vertical
E  a 2 - b2 ,
a
N ,
1  e sin 2 B
2

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 ab
n ,
ab
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:

to  tan Bo , o 2  e2 cos2 Bo


Application for coordinate transformation … 33
̅,Х
Step one: Unmodulation of the coordinates (Gauss-Kruger projection) ((У,Х)GK – (У ̅)
GK),

Y K X
Y ; X ; ( К  7 500 000, m0  0.9999) (1)
0,9999 0,9999

Step two: Transformation of rectangular unmodulated coordinates (Gauss-Kruger


projection) into ellipsoidal-geodetic coordinates (Besell ellipsoid) ((y,x)GK - (B, L)Bes).

to
B  Bo  (1  o 2 ) y 2 
2 No2
to
 (5  3to 2  6o 2  6to 2o 2  3o 4  9to 2o 4 ) y 4 
24 N o 4
(2)
to
 6
(61  90to 2  45to 4  107o 2  162to 2o 2  45to 4o 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  6o 2  8to 2o 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)
    
ab 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

Step three: Transformation of ellipsoidal-geodetic coordinates (Besell ellipsoid) into


rectangular coordinates on the ellipsoid of Bessel ((B, L)Bes - (X, Y, Z)Bes),

x   N  h  cos B cos L (10)

y   N  h  cos B sin L (11)

 
z  N 1  e2   h sin B (12)

Where:

a2
N
a 2 cos 2 B  b 2 sin 2 B

Step four: Transformation of rectangular coordinates on the ellipsoid of Bessel into


rectangular coordinates on the WGS84 ellipsoid ((X, Y, Z) Bes - (X, Y, Z) WGS84),
(Ganić et al., 2014).

 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 

Table 2: Transformation parameters (Republic Geodetic Authority, 2017)

Transformation parameters Standard deviation


Translation х tx = 574.040907 m (tx) = 0.015 m
Translation у ty = 170.129711 m  (ty) = 0.015 m
Translation z tz = 401.553949 m  (tz) = 0.015 m
Rotation х εx = -4.88790271"  (εx) = 0.032"
Rotation у εy = 0.66492609"  (εy) = 0.049"
Rotation z εz = 13.24674576"  (εz) = 0.044"
Scale к = 6.88937746 ppm  (к) = 0.106 ppm
Application for coordinate transformation … 35

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 

Radius of the parallel:

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.

Length of the arc of the meridian

G  B     B   sin 2B   sin 4 B   sin 6 B   sin8B  ... (20)

Coefficients:

ab 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

ab
n , (26)
ab

Ni cos 4  Bes  5  t 2  9 2   4  l 4 
t t
xX 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

t  tan  ,   e '2 cos2  (30)

l    0 (31)

Step seven: Transformation of unmodulated coordinates into modulated coordinates –


̅,Х
UTM projection ((У ̅)УТМ – (У,Х )УТМ),

x  N  x m (32)

y  E  y  m  500000 (33)

m  0,9996 (Х= N, У=Е) (34)


Application for coordinate transformation … 37

3.2 Transformation from UTM projection into Gauss-Kruger projection

Transformation from UTM projection into Gauss-Kruger projection is reverse process.


It should be noted that now process starts in UTM projection and parameters for UTM
projection should be used, i.e. (Lazić, 2010):
(E, N) UTM - (B, L) WGS84 - (X ,Y, Z) WGS84 - (X ,Y, Z) Besel - (B, L) Besel - ( y, x)GK

Step one: Unmodulation of the coordinates (UTM projection),

( E  500000) N
y'  ; x'  (35)
m m

Step two: Transformation from у′ , 𝑥 ′ into (B, L) WGS84


For all calculations should be used parameters of the WGS84 ellipsoid (Table 1) and
formulas from the second step above.
Step three: Transformation from (B, L) WGS84 into (X ,Y, Z) WGS84
Should be used all equations from third step above.
Step four: Transformation from (X ,Y, Z) WGS84 - (X ,Y, Z) Besel
Should be used all equations from previous step four, only exception is that
transformations parameters in reversed process (minus sign) should be used (Table 2)
Step five: Transformation from (X ,Y, Z) Besel into (B, L) Besel
Same equations from the step five above with parameters of the Bessel ellipsoid.
̅,Х
Step six: Transformation from (B, L) Besel into (У ̅)GK

Should be used all equations from the previous step six above.
̅,Х
Step seven: Transformation from (У ̅)GK into modulated (У,Х) GK,

Y  Y  m0  7500000; X  X  m0 ; m0  0.9999 (36)

4. APLICATION FOR COORDINATE TRANSFORMATION USING


„Shiny“ PACKAGE AS PART OF THE „r“ OPEN SOURCE SOFTWARE

„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

Figure 1 Starting the application

Figure 2 Application in window


40 Gojković Z., Radojičić M., Vulović N.

4.1 Application TRANS7_GK-UTM-GK

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.

Figure 3 ui.r component

„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 4 Server.r script file where can be placed r code

4.2. User manual for application TRANS7_GK-UTM-GK

Generally, application TRANS7_GK-UTM-GK consists of two parts. Figure 5 represent


the first part of application and it can be used for individual point transformation. User
must choose direction of transformation. Direction GK2UTM means that user should
write Gauss-Kruger coordinates into fields X(N), Y(E) и Z(h) (zone 7). By clicking
Submit button, on the screen will be shown coordinates transformed into UTM projection
(Figure 6). Changing the direction into UTM2GK user must write UTM coordinates into
corresponding fields and result will be Gauss-Kruger coordinates.

Figure 5 First part of the application


42 Gojković Z., Radojičić M., Vulović N.

Figure 6 Coordinates after transformation


In the second part of the application (Figure 7) user attach file with coordinates,
application then transform coordinates in selected direction and after that user can
download file with transformed coordinates, in csv format, clicking on the button
Download. In the right part of the application it will be shown table with transformed
coordinates after attaching file for user preview (Figure 8).

Figure 7 Second part of the application


Application for coordinate transformation … 43

Figure 8 Table with transformed coordinates

Figure 9 Downloaded file opened into Microsoft excel


44 Gojković Z., Radojičić M., Vulović N.

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.].

CRAN.R-PROJECT.ORG (2016) Package ‘sp’ [Online] Cran.r-project.org. Available


from: https://cran.r-project.org/web/packages/sp/sp.pdf [Accessed: 16.12.2016.].
CRAN.R-PROJECT.ORG (2017) The Comprehensive R Archive Network [Online]
Cran.r-project.org. Available from: https://cran.r-project.org [Accessed: 23.12.2016.].
GANIĆ, A., ALEKSANDAR M. and GANIĆ M. (2014) User defined function for
transformation of ellipsoidal coordinates. Podzemni radovi, 24, pp. 35-47.
JOVANOVIĆ, V. (1983) Matematička kartografija. Beograd: Vojnogeografski institut.
KRUGER, L. (1912) Konforme Abbildung des Erdellipsoids in der Ebene. Royal
Prussian Geodetic Institute, 52.
Application for coordinate transformation … 45

LAZIĆ, S. (2010) Transformacija-koordinata [Online] Republički geodetski zavod.


Available from: https://www.scribd.com/doc/167889642/Transformacija-koordinata
[Accessed: 07.09.2016.].
RADOJČIĆ, S. (2008) Transformacija koordinata između Gaus-Krigerove i Svetske
poprečne Merkatorove projekcije za teritoriju Srbije. Vojnotehnički glasnik, 56(4),
pp. 89-95.
REPUBLIC GEODETIC AUTHORITY (2017) Globalni transformacioni parametri
[Online] Republic Geodetic Authority. Available from: http://www.rgz.gov.rs/template1.asp
?PageName=2005_12_26_1&MenuID=none&LanguageID=2 [Accessed: 20.04.2017.].

SHINY.RSTUDIO.COM (2017) Shiny [Online] Shiny.rstudio.com. Available from:


https://shiny.rstudio.com [Accessed: 16.07.2016.].
WIKIPEDIA (2012) Bessel ellipsoid [Online] Wikipedia. Available from:
https://en.wikipedia.org/wiki/Bessel_ellipsoid [Accessed: 17.05.2017.].

You might also like