开发者

The format to store gps data

I'm trying to store GPS data in a Sqlite database. I retrieve the data from a KML file via DDMS and I store it in a GeoPoint this way:

GeoPoint p = new GeoPoint(latitud开发者_开发知识库e,longitude)

The problem is that GeoPoint() accepts lon and lat only as int, as it is not defined for double format. Now if I have 45.3242355 as longitude this is stored in Sqlite as int-453242355. And I want to use this to draw a line on the map between geopoints, but I can as this format of integer is out from tje range of latitude and longitude. Can someone tell me how should I proceed to get my real format data back?


Multiply it by 10^-6 (1e-6) (and to convert from a double to their integer format, multiply by 10^6 (1e6)). The integer format used by GeoPoint isn't losing data, it's just in microdegrees instead of degrees, as specified by the documentation.

(This is similar to the way a currency field might store a value of $2.36 as "236" to simplify arithmetic and avoid expensive float math and FP errors).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜