Select to view content in your preferred language

Bug in ESRI.ArcGIS.Client.Bing Transform.GeographicToWebMercator()?

710
3
04-09-2010 08:04 AM
HubertLo
Emerging Contributor
Our QA found this in testing. If he puts in Longitude of 180 and Latitude of 90, he got an error in runtime. When I look at the code in design time I found the Y after transformation turns out to be Infinity!

Here is my code snippets:

double dblX = 180;
double dblY = 90;
ESRI.ArcGIS.Client.Geometry.MapPoint mpGeog = new MapPoint(dblX, dblY, new SpatialReference(4326));
ESRI.ArcGIS.Client.Geometry.MapPoint mpGeom = ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator(mpGeog);

Here is the values of mpGeom after transformation:
{Point[X=20037508.3427892, Y=Infinity, WKID=102100]}
    base {ESRI.ArcGIS.Client.Geometry.Geometry}: {Point[X=20037508.3427892, Y=Infinity, WKID=102100]}
    Extent: {20037508.3427892,Infinity,20037508.3427892,Infinity}
    X: 20037508.342789244
    Y: Infinity

Even if I limit the latitude values to 89.99999, the pointed plotted is way off the top of the map. The latitude limit for the map seems to be about 85.05 degree north or south. I guess there is no way to plot a point at north pole!

My questions:
- What is the limitation of the ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator?
- What is the limit in terms of WGS84 geodetic coordinates for World Street Map on ArcGISonline (http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer )?
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
This is just how Mercator works. The poles are infinitely far from the top/bottom. That's why most maps cuts off around 85 degrees, because the distortion beyond that point is getting enormous. You are correct there is no way to plot the poles in Mercator.
So in other words: This is not a bug but expected behavior.

See: http://en.wikipedia.org/wiki/Mercator_projection

- What is the limitation of the ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator?

-180,-90 -> 180,90 (but note that large positive or negative Y values will converge towards infinity)

- What is the limit in terms of WGS84 geodetic coordinates for World Street Map on ArcGISonline (http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer )?

-180,-90 -> 180,90. This goes for all geographic coordinates (well if they use degrees that is 🙂
0 Kudos
HubertLo
Emerging Contributor
Thank you Morten for your answers.

What if we have to plot features up in the poles (Latitude > 85 degrees)? Do you have to go back to ArcGISonline maps that use the WGS84 as spatial reference (SRID 4326) for that? (suppose they are still available now things are moving to SRID 102100.)
0 Kudos
dotMorten_esri
Esri Notable Contributor
Correct. But neither of those two projections are very suitable for displaying data at the poles because of the large distortion they have in those areas.
0 Kudos