如何可編程轉換點與(X,Y)到(LAT,LON)鑑於X_left < X_point < X_right
和Y_bottom < Y_point <Y_top
(即矩形內框)。轉換X,Y座標到緯度,經度GPS位置給出了一些參考點
的(X_left,Y_bottom)點有(緯度,經度)已經,同樣與其他3點,這構建了一個矩形(在這種情況下,平面圖)
一些現實世界的數據雲:
"floor_name": "buildingName_floor_4",
{
"name": "GPS_Marker_0",
"GeoCoordinate": {
"latitude": 1.298825,
"longitude": 103.77004,
"unit": "DEGREES"
},
"MapCoordinate": {
"x": 0,
"y": 0,
"unit": "FEET"
}
},
{
"name": "GPS_Marker_1",
"GeoCoordinate": {
"latitude": 1.298825,
"longitude": 103.77134,
"unit": "DEGREES"
},
"MapCoordinate": {
"x": 473.9,
"y": 0,
"unit": "FEET"
}
},
{
"name": "GPS_Marker_2",
"GeoCoordinate": {
"latitude": 1.29694,
"longitude": 103.77134,
"unit": "DEGREES"
},
"MapCoordinate": {
"x": 474.7,
"y": 683.8,
"unit": "FEET"
}
},
{
"name": "GPS_Marker_3",
"GeoCoordinate": {
"latitude": 1.29694,
"longitude": 103.77004,
"unit": "DEGREES"
},
"MapCoordinate": {
"x": 0,
"y": 683.8,
"unit": "FEET"
}
}
Access Point (need to get lat,lon from its X,Y)
"name": "AP_No_4",
"radioMacAddress": "xx:xx:xx:xx:xx:xx"
"MapCoordinate": {
"x": 179.8,
"y": 299,
"unit": "FEET"
},
我明白,我們可能需要應用任何數學前要弄清楚的映射投影,但讓我解釋一下,這個長方形的盒子(即平面圖)通常是沒有那麼大那麼一些錯誤(例如1米或2)公認。
我更喜歡javascript代碼,但如果你可以指出公式來做到這一點,我很樂意在代碼上工作。謝謝。