Any advantage of storing latitude / longitude as integers?

Recently, I noticed some resources (examples of applications, blogs, and websites) that I use for GPS / GIS materials that store latitude and longitude as integers, not decimal or string. I understand why formatted string is not the preferred way to store lat / lon. But why not save the value as decimal? Is there any advantage to storing an integer and then dividing by 1,000,000 to get the actual decimal value?

+3
source share
1 answer

Maybe. An integer requires only four bytes of memory. The IEEE double precision floating point number is 8 bytes. Thus, saving lat / lon as an integer will reduce the memory requirement by half.

+2
source

Source: https://habr.com/ru/post/1773398/


All Articles