Alex Rivera | Logout

How many significant digits should I store in my database for a GPS coordinate?

Asked 2009-12-22T16:29:19.887
54

I have in my MySQL database both longitude and latitude coordinates (GPS data).

It's currently stored as:

column     type
------------------------
geolat     decimal(10,6)
geolng     decimal(10,6)

Question: Do I really need a data type as large as decimal(10,6) to properly store coordinate data?

Since I have a combined index on the longitude and latitude, this index size is huge. If I can make it smaller without compromising anything, that would be great.

Edit
Report

2 Answers

4

Keep in mind that it's easier to reduce data than it is to increase data. Usually, increasing data accuracy isn't even possible short of remeasuring. And remeasuring comes at a cost. Knowing nothing else of your situation or the industry, I would say capture as much data/specificity as possible.

The data that you actually use can be culled from this set. If you end up needing a higher degree of specificity, you can always recalculate without remeasuring.

Also, I'm not sure that indexing raw data is the best thing to do since it isn't a discrete set of elements. Creating a table of less accurate/smaller data points would make the indexes much smaller.

answered 2009-12-22T16:38:40.250
0

The regular GGA sentance in a NMEA Lat/lon output is only 3decimal places roughly 10m resolution at the equator. Some brands add a custom extra digit to give 1m.

4 digit deg.mm mm/1000 is also common.

If you are using high end precision RTK-GPS you might need more places to get mm precision

answered 2009-12-22T17:00:33.277

Your Answer