簡體   English   中英

如何使用BingMap計算地圖的四個角(邊)的坐標?

[英]How to calculate the coordinates of the 4 corners (edge) of the map with BingMap?

我從幾天開始與bing合作。 我可以使用bing地圖坐標經度和緯度顯示圖像。

但是我想計算 圖像的4個邊緣中的位置坐標 現在,我唯一知道的就是原點的中心。 問題是我僅限於API。 我為xna c#游戲工作,很遺憾無法使用 Microsoft 的類映射:- (。http: //msdn.microsoft.com/zh-cn/library/hh846504.aspx

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

等級縮放:17

圖片寬度:800像素

圖像高度:800像素

緯度:46.6023

經度:7.0964

是否可以使用這5個已知值計算圖像的4個角的坐標? 這是一張解釋我想要的圖。 在此處輸入圖片說明 非常感謝

根據bing maps api為級別17縮放給出的比例尺1.19 m /像素,這使我們得到800 * 1.19 = 95'000米的邊緣( http://msdn.microsoft.com/zh-cn/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

這使用簡化的平地計算,雖然不是最准確的方法,但是應該可以滿足您的需求。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM