如何使用BingMap计算地图的4个角(边)的坐标?

时间:2013-03-06 19:38:12

标签: c# geolocation coordinates bing-maps

有些日子我和bing一起工作。我可以用我的bing地图坐标lontitude和纬度显示图像。

但是我想在我图片的4个边缘中计算位置的坐标。 目前我唯一知道的就是中心点。 问题是我只限于API。我在xna c#上工作,不幸的是无法使用来自microsoft的Class Map :(。http://msdn.microsoft.com/en-us/library/hh846504.aspx

我知道以下值:(样本值)

等级缩放:17

ImageWidth:800 px

Imageheight:800 px

Lat:46.6023

经度:7.0964

是否可以使用已知的5个值计算图像4个角的坐标?这是一张解释我想要的图画。 enter image description here 非常感谢

1 个答案:

答案 0 :(得分:4)

根据bing maps api给出的标尺1.19米/像素进行17级变焦,这给我们800 * 1.19 = 95'000米的边缘 (http://msdn.microsoft.com/en-us/library/aa940990.aspx

你应该能够这样计算:(算法:https://gis.stackexchange.com/questions/2951/algorithm-for-offsetting-a-latitude-longitude-by-some-amount-of-meters

 //Position, decimal degrees
 lat = 46.6023
 lon = 7.0964

 //Earth’s radius, sphere
 R=6378137

 // DO THE SAME FOR B C D

 //offsets in meters for A
 dn = -47600
 de = -47600

 //Coordinate offsets in radians
 dLat = dn/R                      // -0.0074629942881440144669203562106
 dLon = de/(R*Cos(Pi*lat/180))    // -0.00746374633301685016002447644032

 //OffsetPosition, decimal degrees
 latA = lat + dLat * 180/Pi // 46.174701924759107796879309401922
 lonA = lon + dLon * 180/Pi // 6.6687588357618898589751458712973

这使用简化的扁平地球计算,这不是最准确的方法,但应该满足您的需要。

相关问题