Hello,
I’m trying to show either Google/Bing/OpenStreetMap overlay. For project reasons, GeographyUnit must be in DecimalDegree, so I have to “play” with projection conversions.
My problem is that OSM overlay doesn’t use the same coordinates as Google/Bing, so when I switch overlays between these ones, the location showed is different.
For example, here is one section of Madrid’s M-30 motorway in Bing(and Google):
Coordinates: 40.63034, -3.97819
And in OSM:
Coordinates: 40.44469, -3.66067
It’s not a problem of the maps itself because if I go to the OSM web and put the Bing coordinates, the location showed it’s the same as the Bing map, so it has to be something related to the MapSuite or my code.
Here’s a portion of the code to initialize the overlays:
wpfMap.MapUnit = GeographyUnit.DecimalDegree;
//Bing
BingMapsOverlay bingOverlay = new BingMapsOverlay();
bingOverlay.ApplicationId = "...";
Proj4Projection proj4Bing = new Proj4Projection();
proj4Bing.InternalProjectionParametersString = Proj4Projection.GetBingMapParametersString();
proj4Bing.ExternalProjectionParametersString = Proj4Projection.GetDecimalDegreesParametersString();
bingOverlay.ProjectionFromSphericalMercator = proj4Bing;
wpfMap.Overlays.Add("Bing", bing);
...
//OSM
OpenStreetMapOverlay openStreetMapOverlay = new OpenStreetMapOverlay();
Proj4Projection proj4OSM = new Proj4Projection();
proj4OSM.InternalProjectionParametersString = Proj4Projection.GetSphericalMercatorParametersString();
proj4OSM.ExternalProjectionParametersString = Proj4Projection.GetDecimalDegreesParametersString();
openStreetMapOverlay.ProjectionFromSphericalMercator = proj4OSM;
wpfMap.Overlays.Add("OSM", openStreetMapOverlay);
...
What can be the reason of that deviation in OSM?
Thanks in advance,
Euyen