Search code examples
database-designgps

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 longitude 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?


Solution

  • 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.