具有纬度/经度值的 Android GeoPoint [英] Android GeoPoint with lat/long values

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

问题描述

我正在尝试在 45.44334 之前获得 -23.4456 的 GeoPoint

I am trying to get a GeoPoint for -23.4456 by 45.44334

我将哪些值传递给 GeoPoint 的构造函数,因为它只接受 Ints.

What values do I pass into the constructor of the GeoPoint as it take Ints only.

推荐答案

GeoPoint 坐标基于微度 (degrees * 1e6) -- 写成 这里

GeoPoint coordinates are based in microdegrees (degrees * 1e6) -- written here

float lat = -23.4456f;
float lng = 45.44334f;
GeoPoint gp = new GeoPoint((int)(lat * 1E6), (int)(lng * 1E6));

这篇关于具有纬度/经度值的 Android GeoPoint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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