Profile | Register | Active Topics | Search | FAQ

Advanced Search
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 GpsTools
 GpsTools
 How to convert WGS to Gauss-Krüger
 New Topic  Reply to Topic
 Printer Friendly
Digg this
Author Previous Topic Topic Next Topic  

Simon.Vetter
New Member

2 Posts

Posted - 07/01/2009 :  09:37:12  Show Profile  Reply with Quote
Hallo,

how can i translate coordinates from WGS84 to gauss-krüger (mgi28) with Helmert (Bursa-Wolf) 7 parameters (vb6 source-code).

johan
Forum Admin

Sweden
15580 Posts

Posted - 07/01/2009 :  10:13:09  Show Profile  Visit johan's Homepage  Reply with Quote
Take a look at the Position class here:
http://franson.com/gpstools/reference_manual.asp?comp=tools&class=Position&platform=net

Regards,
Johan

Franson Support
Go to Top of Page

Simon.Vetter
New Member

2 Posts

Posted - 07/02/2009 :  08:06:15  Show Profile  Reply with Quote
Thank you for this fast answer!
I've allready read this article but my calculation doesen't work.
Here my Problem again:
I've to convert WGS84 coordinates into Gauss-Krüger MGI28 with Helmert (Bursa-Wolf) 7 parameters.

So i've tryed this in Visual Basic 6:

Private Sub Command1_Click()
'Objekte und Variabeln initialisieren
'-----------------------------------------------------------------------------------------------------------------------------------------------
Dim oLicense As New License
Dim posFranson As New GpsToolsXP.Position
Dim posFransonGK As New GpsToolsXP.Position
Dim bessel As New CustomDatum
Dim orgLongitude As Variant
Dim orgLatitude As Variant
Dim Longitude As Variant
Dim Latitude As Variant

'Koordinaten einen Wert zuweisen
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Orginal Koordinaten<-"
orgLongitude = "9°43'14.67737''"
orgLatitude = "47°23'15.87760''"
Debug.Print " orgLatitude: " & orgLatitude
Debug.Print " orgLongitude: " & orgLongitude

'Umrechnen von Koordinaten in Dezimalgrad
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Koordinaten umrechnen in Dezimalgrad<-"
Longitude = UmrechnenKoordinaten(orgLongitude, True)
Latitude = UmrechnenKoordinaten(orgLatitude, True)
Debug.Print " Latitude: " & Latitude
Debug.Print " Longitude: " & Longitude

'Licenz
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Licenz setzen<-"
oLicense.LicenseKey = "key"

'Import Datum
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Import-Datum<-"
posFranson.Datum = 1
Debug.Print " Datum: " & posFranson.Datum

'Import Koordinaten
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Import-Koordinaten an Franson übergeben<-"
posFranson.Latitude = Latitude '9.720743714
posFranson.Longitude = Longitude '47.38774378
Debug.Print " Latitude: " & posFranson.Latitude
Debug.Print " Longitude: " & posFranson.Longitude

'Neues Ellipsoid definieren (Bessel 1841)
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Custom-Datum<-"
bessel.SemiMajorAxis = 6377397.155
bessel.InverseFlattering = 299.1528434
bessel.E2 = 0.006674372

bessel.DeltaX = 547.83256
bessel.DeltaY = 117.53815
bessel.DeltaZ = 402.22161

bessel.RotX = 6.18772802
bessel.RotY = 0.87110478
bessel.RotZ = 4.72902138

bessel.ScaleFactor = -0.000012102213

Debug.Print " SemiMajorAxis: " & bessel.SemiMajorAxis
Debug.Print " InverseFlattering: " & bessel.InverseFlattering
Debug.Print " E2: " & bessel.E2

'Wechseln von Ellipsoid
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Ellipsoid wechseln<-"
Set posFranson.CustomDatum = bessel

'Ausgabe neue Koordinaten
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Neue Koordinaten<-"
Debug.Print " Latitude: " & posFranson.Latitude
Debug.Print " Longitude: " & posFranson.Longitude

'Umrechnen von Koordinaten in Grad Min Sek
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Koordinaten umrechnen in Grad Min Sek<-"
Longitude = UmrechnenKoordinaten(posFranson.Longitude, False)
Latitude = UmrechnenKoordinaten(posFranson.Latitude, False)
Debug.Print " Latitude: " & Latitude
Debug.Print " Longitude: " & Longitude

'Umrechnen in GaussKrüger
'-----------------------------------------------------------------------------------------------------------------------------------------------
Debug.Print "->Importdatum für Umrechnung in GK angeben<-"
Set posFransonGK.CustomDatum = bessel
Debug.Print " Datum: " & posFransonGK.Datum

Debug.Print "->Übergebe Koordinaten an Franson für Umrechnung in GK<-"
posFransonGK.Longitude = posFranson.Longitude
posFransonGK.Latitude = posFranson.Latitude
Debug.Print " Longitude: " & posFransonGK.Longitude
Debug.Print " Latitude: " & posFransonGK.Longitude

Debug.Print "->Gebe Grid an (M28)<-"
posFransonGK.Grid = 17
Debug.Print " Grid: " & posFransonGK.Grid

Debug.Print "->Umgerechnete Koordinaten in GK<-"
Debug.Print " Northing: " & posFransonGK.Northing
Debug.Print " Easting: " & posFransonGK.Easting - 150000

''''''''''
'->Ende<-'
''''''''''
End Sub

Private Function UmrechnenKoordinaten(ByVal Koordinate As String, ByVal Dezimalgrad As Boolean) As String

'Variablen Initialisieren
'-----------------------------------------------------------------------------------------------------------------------------------------------
Dim arrTemp() As String
Dim Grad As String
Dim Min As String
Dim Sek As String
Dim help As String

'Umrechnen in Dezimalgrad
'-----------------------------------------------------------------------------------------------------------------------------------------------
If Dezimalgrad = True Then
arrTemp = Split(Koordinate, "°")
Grad = arrTemp(0)
arrTemp = Split(arrTemp(1), "'")
Min = arrTemp(0)
Sek = Left(arrTemp(1), Len(arrTemp(1)))

UmrechnenKoordinaten = (((CDbl(Sek) / 60) + CDbl(Min)) / 60) + CDbl(Grad)

'Umrechnen in Grad Minuten Sekunden
'-----------------------------------------------------------------------------------------------------------------------------------------------
Else
arrTemp = Split(Koordinate, ".")
Grad = arrTemp(0)
arrTemp = Split(("0." & arrTemp(1)) * 60, ".")
Min = arrTemp(0)
Sek = ("0." & arrTemp(1)) * 60
UmrechnenKoordinaten = Grad & "° " & Min & "' " & Sek & "''"
End If
End Function


--> Now is my problem, that i don't get the right coordinates.
There is a difference betwen 0.30m - 1.5m.
So can you help me with my problem?

Go to Top of Page

FugroAustria
New Member

Austria
3 Posts

Posted - 01/22/2010 :  13:44:41  Show Profile  Visit FugroAustria's Homepage  Reply with Quote
I had a similar problem when i used E2 and InverseFlattening

Try to user E2 only

bessel.SemiMajorAxis = 6377397.155
bessel.E2 = 0.006674372
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
GpsGate Forum © 2014 GpsGate AB Go To Top Of Page