如何转换的GeoPoint经度+纬度翻番? [英] How to convert geopoint longitude +latitude to double?

查看:258
本文介绍了如何转换的GeoPoint经度+纬度翻番?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我检索地图视图的中心,我需要通过多头和拉特的双打,以我的服务器对数据库进行测试。

I am retrieving the center of a map view and i need to pass the longs and lats as doubles to my server for testing against the database .

我将如何去有关转换mapView.getMapCenter()。getLongitudeE6()为双?

How would i go about converting mapView.getMapCenter().getLongitudeE6() to a double ?

推荐答案

调用 mapView.getMapCenter()返回的GeoPoint GeoPoint.getLongitudeE6() GeoPoint.getLatitudeE6()都返回microdegrees(基本上度* 1E6)。

Calling mapView.getMapCenter() returns a GeoPoint. GeoPoint.getLongitudeE6() and GeoPoint.getLatitudeE6() both return microdegrees (basically degrees * 1E6).

所以,在Java中,以microdegrees转换为度简单地做:

So, in Java, to convert microdegrees to degrees simply do:

public static double microDegreesToDegrees(int microDegrees) {
    return microDegrees / 1E6;
}

这篇关于如何转换的GeoPoint经度+纬度翻番?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆