2016-07-06 10 views
0

Ich muss eine große Anzahl von Koordinaten im ETRS89-Format in WGS84 Lat Long konvertieren.Konvertieren von Koordinaten ETRS89/LCC zu WGS84 Lat Long

Soweit ich weiß, ETRS89 und WGS84 sind fast gleich, aber sie haben völlig andere Werte.

Ich brauche die WGS84-Koordinaten für Bing-Maps.

Wäre toll, wenn es eine einfache Lösung in C# für dieses Problem gibt.

Vielen Dank viel :)

Antwort

0

Erste Wahl für eine solche Transformation ist die Proj4 Projekt. Es sind mehrere Ports verfügbar, z. Java (Java Proj.4), JavaScript (Proj4js), .NET (Proj4Net) usw.

Kommandozeilenwerkzeug cs2cs.exe verwendet wird Koordinaten zu transformieren, würde der Befehl wie folgt sein:

cs2cs +init=epsg:3034 +to +init=epsg:4326 {name of your text-file containing massive amount of coordinates} 

das ist äquivalent zu

cs2cs +proj=lcc +lat_1=35 +lat_2=65 +lat_0=52 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs 
    +to +proj=longlat +datum=WGS84 +no_defs {name of your text-file containing massive amount of coordinates} 

Falls Sie lieber C# meine persönlichen Favoriten DotSpatial.Projections und ProjApi (Datei csharp-4.7.0.zip)

sind

Beispiel für DotSpatial:

double[] xy = new double[2]; 
xy[0] = 12345; 
xy[1] = 67890; 
double[] z = new double[1]; 
z[0] = 1; 
ProjectionInfo pStart = KnownCoordinateSystems.Projected.Europe.ETRS1989LCC; 
ProjectionInfo pEnd = KnownCoordinateSystems.Geographic.World.WGS1984; 
Reproject.ReprojectPoints(xy, z, pStart, pEnd, 0, 1); 

Beispiel mit Proj-API:

var src = new Projection(@"+proj=lcc +lat_1=35 +lat_2=65 +lat_0=52 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"), 
var dst = new Projection(@"+proj=longlat +datum=WGS84 +no_defs")) 

double[] x = { -116, -117, -118, -119, -120, -121 }; 
double[] y = { 34, 35, 36, 37, 38, 39 }; 
double[] z = { 0, 10, 20, 30, 40, 50 }; 

Projection.Transform(src, dst, x, y); 
Verwandte Themen