【问题标题】:How to get 13 numbers behind decimals of Latitude and Longitude如何获得纬度和经度小数点后的 13 个数字
【发布时间】:2012-04-20 12:18:37
【问题描述】:

我使用以下方法获取当前的经纬度:

 locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
            if (locationManager == null) {
                Toast.makeText(LocationsListActivity.this,
                        "Location Manager Not Available", Toast.LENGTH_SHORT)
                        .show();
            }
            location = locationManager
                    .getLastKnownLocation(LocationManager.GPS_PROVIDER);
            if (location == null)
                location = locationManager
                        .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
            if (location != null) {
                double lat = location.getLatitude();
                    double lng = location.getLongitude(); 

但问题是我得到的 lat 和 lng 小数点后只有 8 个数字(lat: 52.51491445, lng: 13.39044515) 我想要的是我得到的 lat 和 lng 在小数点后有 13 个数字。

我该怎么做? 谢谢

【问题讨论】:

  • 你确定 lat 只有 8 位小数吗?或者它只是这个值的字符串表示......
  • en.wikipedia.org/wiki/Floating_point ... 你看到的只是一个字符串 ... 也许 Double.toString() 让它看起来只有 8 位小数
  • 这样可以得到多于12位小数的经纬度吗?

标签: android google-maps gps


【解决方案1】:

您可以查看 Criteria 的 setAccurary() 方法和 setPowerRequirement() 方法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-04
    • 2015-07-12
    • 2012-03-29
    • 2011-07-06
    • 2019-10-11
    • 1970-01-01
    • 2011-08-18
    • 2017-01-01
    相关资源
    最近更新 更多