You are on page 1of 6

1 Transformations between WGS84 and local coordinate

systems
When using GPS measurement data, one always has to transform global geocentric WGS84
coordinates to the desired local coordinate system or projection. Sometimes also the opposite
way is needed, for example when setting up a GPS reference station.
In the following, the necessary steps are explained, together with the use of the Geodetic

Transformation“ files for Matlab.

1.1 What steps are to perform?


The basic steps when transforming a global to a local pro-
B,L,H (WGS84) jection system is shown in fig.1, e.g. the transformation from
WGS84 to the German Gauss-Kruger (GK) system. In prin-
ciple, the underlying ellipsoids and the projection can be ar-
bitrarily changed by adapting the appropriate parameters.
X,Y,Z (WGS84) First, the geographic coordinates (Lat, Long, Height) on
the origin ellipsoid are transformed to cartesian coordinates
(X,Y,Z) on the origin ellipsoid using the known ellipsoid pa-
Parametersatz rameter set.
Second step is the datum transformation from the origin to
x,y,z (Bessel) the target ellipsoid. This is a 3D similarity transformation
based on 7 parameters (3 translations, 3 rotations and 1 scale
factor), which performs kind of a best fit of the two ellipsoid
shapes at the projected area. To get these parameters, one
needs at least three points with known coordinates in both
B,L,h (Bessel) systems, for example by doing GPS-measurements on geode-
tic fixpoints. The parameters then give precise results up to a
few millimeters. If these parameters are not known, you can
use more unexact parameters valid for larger areas, these are
provided by the Geodetic State Offices and normally give pre-
R,H,h (GK) cision of a few meters.
We now already have coordinates on the target ellipsoid, but
Abbildung 1: Transformation cartesian ellipsoidal ones which give no information about po-
from WGS84 to local Gauss- sition and height. To get these, in the third step it is necessa-
Kruger system ry to transform the cartesian coordinates back to geographic
coordinates. Now we get (Long, Lat, Height) on the target
ellipsoid.
Last step is the projection itself, i.e. the flattening“ of the ellipsoid surface to a plane. Longi-

tude and Latitude can be transformed into easting and northing; the obtained height still is an
ellipsoidal height and needs to be adopted to the desired height system using geoid undulation.
Performing the transformation in opposite direction means doing all the steps above in opposite
order. Un-doing the last step (i.e. from projection to geographic coordinates) often is a pro-
blem, because the heights of the points to transform are not always known together with their
undulation. One can use a median height, but transformation results tend to become ı́nexact
then (for a rather small transformation area only small deviations).
The transformation from one projection system to another (e.g. from UTM to GK) has the same
steps to perform as mentioned above (including the 3D-similarity transformation). There is no
Satellitengestützte Positionierung
1. Transformations between WGS84 and local coordinate systems

way directly from projection to projection (well, there is, but only for very small transformation
areas...)

1.2 Geographic → Cartesian (La,Lo,H) → (X,Y,Z)


One uses the formula
X = (N + H) cos La cos Lo
Y = (N + h) cos La sin Lo (1.1)
Z = (N (1 − e2 ) + H) sin La
with N being
a a2
N=p =√ (1.2)
1 − e2 sin2 B a2 cos2 B + b2 sin2 B
and a, b = semimajor and semiminor axes of the ellipsoid and e the 1. eccentricity
a2 − b2
e2 = (1.3)
a2
These formula provide a right-handed system with its origin in the axes intersection point and
the x-axes pointing to the origin meridian.

1.3 Ellipsoid transformation (X,Y,Z) → (x,y,z)


Changing the ellipsoids happens in cartesian coordinates. Three translations transform the
ellipsoid centers into another, three rotations align the axes directions, and also a scale factor
is provided.
The well-known formula for a 3D similarity transformation is used:
     
x dx X
y  = dy  + m · D ·  Y  (1.4)
z dz Z
mit der Rotationsmatrix
 
cos εy cos εz sin εx sin εy cos εz + cos εx sin εz − cos εx sin εy cos εz + sin εx sin εz
D = − cos εy sin εz − sin εx sin εy sin εz + cos εx cos εz cos εx sin εy sin εz + sin εx cos εz 
sin εy − sin εx cos εy cos εx cos εy
for right-handed systems.
For most datum transformations the ellipsoids are nearly parallel, therefore the rotation angles
are small. We can simplify the rotation matrix using
       
x dx 1 εz −εy X
y  = dy  + m · −εz 1 εx  · Y
 (1.5)
z dz εy −εx 1 Z
these transformation step can be used for both directions; if you have the parameters for
transforming system A to B and want to transform B to A, you need to invert the formula (1.5)
and use        
X 1 −εz εy x dx
1    
 Y  =  εz 1 −εx ·  · y − dy (1.6)
m
Z −εy εx 1 z dz
Working in very small areas, sometimes only translation is obtained (this is not advised!).

2
Satellitengestützte Positionierung
1. Transformations between WGS84 and local coordinate systems

1.4 Cartesian → geographic (x,y,z) → (La,Lo,h)


To have an idea of 2D position and height information, it is necessary to transform the cartesian
coordinates back to geographic ellipsoidal coordinates by inverting the formula (1.1). Longitude
directly is given by
y
Lo = arctan use right quadrant! (1.7)
x
Latitude and height must be calculated iteratively. A good starting value for latitude is
z
La0 = arctan p
x2 + y 2

Iteration then uses


a
Ni = p (1.8)
1 − e sin2 Lai
2
p
x2 + y 2
hi = − Ni (1.9)
cos Lai
³ z ¡ e2 Ni ¢−1 ´
Lai+1 = arctan p 1− (1.10)
x2 + y 2 Ni + hi

and is performed until no further value changes show up. It converges very fast.

1.5 Geographic → Projection (La,Lo,h) → (E,N,h)


To finally get projected coordinates, one needs information about the projection rules of the
desired target system. When using GK or UTM projection, one needs to know about the central
meridian Lo0 of the actual working zone.
Then
l = Lo − Lo0 (1.11)
and
tan La ¡ 1
· 1 + η 2 (1 − 3 sin2 La)l4
¢
tan Laf = (1.12)
cos(V · l) 6
with √ √
V = 1 + e′2 cos2 La η= e′2 cos2 La (1.13)
and e′ being the 2nd eccentricity
a2 − b2
e′2 =
b2
Knowing the scale factor m0 of the projection and using
a−b
n=
a+b
we get for the northing (̺ multiplication factor from degree to radians)

N a ¡ 1 1 Laf 3 1
= (1 + n2 + n4 ) − n(1 − n2 ) sin 2Laf +
m0 1+n 4 64 ̺ 2 8 (1.14)
15 1 35 315 4
+ n2 (1 − n2 ) sin 4Laf − n3 sin 6Laf +
¢
n sin 8Laf − . . .
16 4 48 512

3
Satellitengestützte Positionierung
1. Transformations between WGS84 and local coordinate systems

Shortened easting y is calculated using


1 1 1 ¢
tan l cos Laf · 1 + ηf2 l2 cos2 Laf ( ηf2 + l2 )
¡
sinh ỹ = (1.15)
Vf 6 10

with V, η obtained from (1.13) and finally

a2
y = m0 ỹ (1.16)
b
GK-coordinates have a scale m0 = 1 while UTM has 0,9996.
Final easting then is the shortened one plus a constant addition and a meridian ID number;
e.g. using GK coordinates it is

EGK = y + 500000m + (zoneidentif ier) · 1000000m (1.17)

Using UTM, the formula is identical, with 6◦ -zones counting from the date line (zone ID in
Germany e.g. 32 and 33).

1.6 Projection → geographic (N,E,h) → (La,Lo,h)


When one starts from a projection, not from GPS coordinates; the first step is to undo the
projection. The formula from the last section have to be inverted then, one gets

La′ 1+n 1 N
= · 1 2 1 4 ·
̺ a 1 + 4 n + 64 n m0
Laf La ′
3 9 1 55 (1.18)
= + n(1 − n2 ) sin 2La′ + n2 (21 − n2 ) sin 4La′ +
̺ ̺ 2 16 16 2
151 3 1097 4
+ n sin 6La′ + n sin 8La′ + . . .
96 512
and the shortened geographic longitude
Vf 1 1
sinh ỹ · 1 − ηf4 ỹ 2 − e′2 ỹ 4
¡ ¢
tan l = (1.19)
cos Laf 6 10

whereby, concerning(1.16),
y·b
ỹ =
m 0 · a2
and finally
Lo = Lo0 + l
Geographic latitude then is
1
tan La = tan Laf cos(Vf · l) · 1 − ηf2 l4
¡ ¢
(1.20)
6
It is often a problem to work with height in this step, because this is a 2D to 3D transformation.

4
Satellitengestützte Positionierung
1. Transformations between WGS84 and local coordinate systems

1.7 Height systems


Ellipsoidal calculations of heights in
the sections above always bring up
ellipsoidal heights, of course. These
are defined in a geometric way and
provide no physical information. The
do not follow plumb lines and the-
refore give no absolute information
about being up“ or down“.
” ”
To obtain heights with physical
Abbildung 2: Definition of height (taken from: background, one has to add geoid
Hofmann-Wellenhof: GPS in Practice) undulation using
h=H +N (1.21)
where h is the ellipsoidal height, H die orthometric height und N the undulation. Undulations
are tabularized.

1.8 An example for using the Matlab functions


Assume we have a point p1 to transform with the ellipsoidal WGS84 coordinates
Long = 11.569588 ◦
Lat = 48.147736 ◦
H = 566.224 m
(which is located close to the Pinakothek in Munich).
Use the ell2cart-function to get Cartesian coordinates:
p2=ell2cart(p1,’wgs84’)
and you get
p2 = [4177239.71597258 855153.760874521 4728274.16693773]
These are the same coordinates that your GPS receiver might output, when it’s set to send
WGS84 cartesian, of course. We now have global Cartesian coordinates which can be transfor-
med to global Cartesian coordinates on another underlying ellipsoid.
For the 3D similarity transformation let’s use a parameter set which is suitable for whole Ba-
varia and exact down to a few meters
Param= [
-604.7365 transl x
-72.3946 transl y
-424.402 transl z
3.49114331766977e-006 rot x
5.38967369289471e-007 rot y
-8.34330408231834e-006 rot z
0.9999947621 scale
]
In the function d3trafo you also have to enter the origin of the rotation, which for the para-
meters above is the earth center [0 0 0] (Bursa-Wolf transformation type). Sometimes rotation

5
Satellitengestützte Positionierung
1. Transformations between WGS84 and local coordinate systems

center is located close to the transformated area, then it is called Molodensky-Badekas type.
For our example, we write
p3 = d3trafo(p2,Param,[0 0 0])
and therefore get
p3 = [4176603.41608393 855128.245803322 4727824.26461638]
Now we are on the right ellipsoid, Bessel.
The next step is to transform the Cartesian coordinates to ellipsoidal coordinates on the new
Bessel ellipsoid. We simply do this using
p4 = cart2ell(p3,’besseldhdn’)
and get
p4 = [11.5709671367179 48.1486519421174 514.779124955647]
Note, that ’bessel1841’ and ’besseldhdn’ produce the same results down to far less than one
millimeter.
The last step to perform is the projection of the ellipsoidal coordinates on the plane and therefo-
re in Gauss-Kruger coordinates. To use German GK system, you must know in which longitude
band you’re in with your position. There are different bands, located around the reference me-
ridians 6, 9, 12 and 15 with an extension of 1.5 to both sides and an additional overlapping
zone. Here in Munich, we are in the 12-zone. So the proper command is
p5 = ell2proj(p4,12,’gk’)
which results in
p5 = [4468079.26968496 5334501.26735424 514.779124955647]
and gives the final GK-coordinates.

You might also like