The lat/lon floating point delusion
21–30 of 154 posts
Re: The lat/lon floating point delusion
#22Re: The lat/lon floating point delusion
#23Re: The lat/lon floating point delusion
#24Not just lat/lon. I find myself amused when The Washington Post's education columnist Jay Matthews--quite a sharp guy from all I can tell--runs his high school "challenge index" (AP tests taken / size of graduating class) out to six decimal points for small schools. Somebody give that man a slide rule.
At work, I recently saw a survey result from a small customer base reported as "31.3% of respondents" rather than the more communicative "5 out of 16..."
Re: The lat/lon floating point delusion
#25Earlier quoted context omitted.
Error tends to grow as the calculation proceeds. 6th-decimal "insignificant rounding" done over and over as the calculation proceeds can grow to become arbitrarily large.
Which calculation on lat/lon coordinates would make an atom-scale error grow, say, a million times to millimeter-size?
Re: The lat/lon floating point delusion
#26Earlier quoted context omitted.
> We shouldn't round off internally because we might use it in as an intermediate result in a calculation. Only if the precision is meaningful. The author's point is that it isn't for geographical coordinates.
Error tends to grow as the calculation proceeds. 6th-decimal "insignificant rounding" done over and over as the calculation proceeds can grow to become arbitrarily large.
Re: The lat/lon floating point delusion
#27I usually go with 6 decimal places. Geojson format advises it also https://tools.ietf.org/html/rfc7946#section-11.2
If you actually read the RFC, it's giving a common example as an artifact of sprintf, and explicitly stating that implementations should consider how much precision they need...
Re: The lat/lon floating point delusion
#28The author also ignores the fact that the distance associated with a degree of longitude changes dramatically as you go from the equator (69m/111km) to the poles (0) - roughly as a cosine. So the number of decimal places of longitude should shrink as you get further from the equator. https://www.thoughtco.com/degree-of-latitude-and-longitude-d... "At 40 degrees north or south, the distance between a degree of longitu…
Its almost like if I was to record where an astronomical object was using only time. Assuming you have full knowledge of its past trajectory, depending on how fast that object moves, you would need different precision times for objects traveling at different velocities, to get the same precision in space.
This is why you just give up on the problem and report to a precision that always works, instead of using the standard scientific procedure of significant figures. I guess if GPS measurement devices took all this into account they could report their measurements with the correct number of digits (taking into account measurement error, and the absolute position on Earth). I guess 15 digits is always too many, but whatever.
Re: The lat/lon floating point delusion
#29The author also ignores the fact that the distance associated with a degree of longitude changes dramatically as you go from the equator (69m/111km) to the poles (0) - roughly as a cosine. So the number of decimal places of longitude should shrink as you get further from the equator. https://www.thoughtco.com/degree-of-latitude-and-longitude-d... "At 40 degrees north or south, the distance between a degree of longitu…