0
A
回答
0
給我的答案是從這個鏈接:stackoverflow.com/questions/37348207/find-location-1-km-away-in-180-degree-south-from-my-location/37349396# 37349396
使用以下庫:https://github.com/JavadocMD/simplelatlng 但這計算方法如下:
/**
* <p>
* Calculate the end point of traveling along a great-circle path from a
* given starting point with a given intitial bearing for a known distance.
* </p>
*
* @param start
* the starting point.
* @param initialBearing
* the initial bearing.
* @param distance
* the distance to travel.
* @param unit
* the unit in which distance is measured.
* @return the end point.
*/
public static LatLng travel(LatLng start, double initialBearing, double distance,
LengthUnit unit) {
double bR = Math.toRadians(initialBearing);
double lat1R = Math.toRadians(start.getLatitude());
double lon1R = Math.toRadians(start.getLongitude());
double dR = distance/LatLngConfig.getEarthRadius(unit);
double a = Math.sin(dR) * Math.cos(lat1R);
double lat2 = Math.asin(Math.sin(lat1R) * Math.cos(dR) + a * Math.cos(bR));
double lon2 = lon1R
+ Math.atan2(Math.sin(bR) * a, Math.cos(dR) - Math.sin(lat1R) * Math.sin(lat2));
return new LatLng(Math.toDegrees(lat2), Math.toDegrees(lon2));
}
相關問題
- 1. 計算從一個GPS座標到另一個座標的距離?
- 2. 計算距離,給定一組座標
- 3. 的Python:計算eucledean距離從一個座標,座標
- 4. 計算由距離從另一個座標座標
- 5. GPS座標距離測量
- 6. 從多個GPS座標計算到最近岸的距離
- 7. Python從2個GPS座標計算速度,距離,方向
- 8. 計算一個位置座標距另一個座標一定距離
- 9. 計算座標之間的距離
- 10. 以度爲單位的GPS座標計算距離
- 11. 以度爲單位的GPS座標來計算距離
- 12. 計算座標基於距離
- 13. 計算距離座標公里與Java
- 14. 在Laravel中計算座標距離
- 15. GPS座標得到錯誤的距離
- 16. 計算GPS座標半徑
- 17. 使用GPS座標進行最短距離計算
- 18. 使用GPS座標計算道路距離
- 19. 用起始位置和距離計算新的座標
- 20. 從距離Xyz座標
- 21. Java - 根據給定的座標,方位和距離計算第二個座標
- 22. 從距離和方位計算點/座標
- 23. 從GPS座標組獲得最大距離
- 24. Cython - 計算二維座標之間的距離數組
- 25. 計算兩組座標之間的距離(NSStrings)
- 26. 計算具有一個新的座標,座標+在X,Y和Z方向上的距離
- 27. 從文件中調用座標的距離計算(Python2.7)
- 28. 間接計算兩個GPS座標之間的距離(不使用實際座標)
- 29. 通過添加度量距離獲取新的GPS座標
- 30. 從座標列表的最小距離查找座標
[這裏的一個鏈接](http://stackoverflow.com/questions/37348207/find-location-距我的位置1公里的南緯度/ 37349396#37349396)到以前的答案。你可以使用那裏提到的庫(如果許可證是好的),或者只是抓住基本想法並編寫自己的代碼。 –
嘿謝謝你!我在找什麼 – TheQ