Last updated
Last updated
ref :
In SQL database, Latitude and Longitude data types should use DECIMAL instead of FLOAT.
E.g. DECIMAL(9,6) depending on the precision required
###.######
OR
Use MySQL's spatial extensions with GIS.
Another practical way is to use integer or number.
We store latitude/longitude X 1,000,000 in our oracle database as NUMBERS to avoid round off errors with doubles.
Given that latitude/longitude to the 6th decimal place was 10 cm accuracy that was all we needed. Many other databases also store lat/long to the 6th decimal place.
Thus an Int data type could also serve the purpose. Say 168.123456 * 1 000 000 = 168 123 456
is still much less than the signed integer limit which is around 2 billion (2 * 10^9).