I'm building a software application that uses GPS for a purpose related to roads.
I'd like to know how many decimal places of GPS data should be stored to provide measurements that are accurate to within a few feet?
I'm building a software application that uses GPS for a purpose related to roads.
I'd like to know how many decimal places of GPS data should be stored to provide measurements that are accurate to within a few feet?
The circumference of the earth is about 25,000 miles [40,075 km], or 131.5 Mfeet. That divided by 360 is 365 kfeet/degree [111.3 km/degree]. A degree value with 4 decimal places has a implied accuracy of 0.00005 deg, or 18 feet [5.5 m]. That's roughly the accuracy of a typical consumer grade GPS anyway, so there is little point going farther. If you have a special (and expensive) surveying grade GPS, then you can use 5 decimal places and get about 1.8 foot [0.5 m] numerical accuracy. Each extra digits reduces the numerical error by a factor of 10. Degrees with 6 fraction digits would be specifying location to about 2 inches [about 5.5 cm].
Note that the above was assuming the worst case where the 360 degrees are spread out over the entire circumference of the earth. That is true for longitude at the equator, and latitude everywhere. The numeric accuracy of longitude is what is computed above scaled by the cosine of the latitude.
There are some complicated maths to calculate distances from GPS coordinates. The actual distance per degree (latitude and longitude are degrees) varies depending on where you are on the planet.
However, you only need to know the maximum distance per degree anywhere on Earth. According to this wikipedia page this distance is just under $112km$.
So to store values accurate to $1m$, you need to store to a precision of $1/112000$, which is $0.00000893$. So storing six decimal places should give you the precision you need.