'GPS Coordinates in 4 bytes
I am trying to find a method to store the standard Latitude and Longitude (double---both of 8 bytes) in 4 bytes, and viceversa (i.e. convert these data in the standard 8 byte latitude/longitude). Honestly, it is not clear how to do that. I am programming in C++, so if there is an existing function or library to do that, it would be good.
Solution 1:[1]
Fixed point rational representation is a potential solution for this purpose.
There is no fundamental type for fixed point rational numbers, nor does the standard library provide types implementing them. The idea is fairly simple however: Scale the value of an underying integer such that the range of the underlying integer is mapped to the desired range of values.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
