开发者

Any advantage to storing latitude / longitude as integers?

Lately I've noticed some of the resources (sample applications, blogs, and websites) I use for GPS / GIS stuff store the latitude and longitud开发者_运维百科e as integers rather than decimal or string. I understand why a formatted string is not the preferred way to store lat / lon. But why not store the value as a decimal? Is there any advantage to storing as an integer and later dividing by 1,000,000 to get the actual decimal value?


Possibly. An integer requires only four bytes of storage. An IEEE double precision floating point number is 8 bytes. So storing a lat / lon as an integer would halve the memory requirement.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜