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. 計算距離,給定一組座標
- 2. 的Python:計算eucledean距離從一個座標,座標
- 3. GPS座標距離測量
- 4. 從多個GPS座標計算到最近岸的距離
- 5. 計算一個位置座標距另一個座標一定距離
- 6. 計算座標之間的距離
- 7. 以度爲單位的GPS座標計算距離
- 8. 在Laravel中計算座標距離
- 9. 計算距離座標公里與Java
- 10. GPS座標得到錯誤的距離
- 11. 計算GPS座標半徑
- 12. 從距離和方位計算點/座標
- 13. 計算具有一個新的座標,座標+在X,Y和Z方向上的距離
- 14. 計算行車距離到一個特定的座標
- 15. pgf/tikz:如何計算x座標之間的一半距離?
- 16. 如何找到已知GPS距離的GPS座標?
- 17. 計算邊界框距離Java中的緯度/經度座標一定距離
- 18. 從x,y,z座標計算歐幾里得距離矩陣
- 19. 從shp文件讀取座標並計算距離
- 20. 獲取地理座標對給定源座標對和距離
- 21. 標籤座標軸與座標圖的距離不同
- 22. QuickTime GPS座標
- 23. gps座標+米
- 24. 通過添加固定距離獲取下一個GPS座標
- 25. 如何從像素座標計算歸一化圖像座標?
- 26. Mathematica中的直角座標系中的計算距離
- 27. android-get最新gps座標
- 28. 計算2個座標之間的距離iphone - 最佳做法
- 29. 如何使用座標計算兩點的距離?
- 30. 計算兩個x/y座標之間的距離?
[這裏的一個鏈接](http://stackoverflow.com/questions/37348207/find-location-距我的位置1公里的南緯度/ 37349396#37349396)到以前的答案。你可以使用那裏提到的庫(如果許可證是好的),或者只是抓住基本想法並編寫自己的代碼。 –
嘿謝謝你!我在找什麼 – TheQ