I need to store GPS coordinates in a database. I\'ve heard that floats are less accurate than decimals. Is that true? If so, what reason is there to ever use floats?
Since Earth equatorial circumference is around 40000 km and longitude spans 360 degrees, it follows that near the equator 1 degrees is equivalent to about 110 km.
Thus:
However, the closer you move to the Poles, the smaller the lenghts of the parallels becomes.
For example near Paris, which has a latitude of 48 degrees, 1 degree is equivalent to cos(48) * 110 = 74 km
.
Thus:
So, field of type DECIMAL(10,7)
would be enough to satisfy you rather precise.