Live data from Hacker News

The lat/lon floating point delusion

datafix.com.au

61–70 of 154 posts

Re: The lat/lon floating point delusion

#61

Agreement on the decimal places. But honestly, why would you commit to using GPS as the end means of locating in Australia when you'll be noticeable off in 20 years and outright inaccurate in 100? https://www.nationalgeographic.com/news/2016/09/australia-mo...

Using GPS/WGS84 to locate is fine, you just need to convert to a plate-local datum before long-term storage of those coordinates.

Re: The lat/lon floating point delusion

#62
post #3

Not 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.

Here in the frozen north, newpapers^H^H^H^H^H^H sites insert metric conversions everywhere. “I must have lost ten pounds [4.5359237 kg] on that run!”

Re: The lat/lon floating point delusion

#63

Agreement on the decimal places. But honestly, why would you commit to using GPS as the end means of locating in Australia when you'll be noticeable off in 20 years and outright inaccurate in 100? https://www.nationalgeographic.com/news/2016/09/australia-mo...

I wonder why they don’t mention that Australia’s new datum (GDA2020) will be rolled out next year.

Here are more details: https://www.google.com/amp/s/theconversation.com/amp/austral...

And on their official web site: http://www.icsm.gov.au/datum/gda2020-fact-sheets

Re: The lat/lon floating point delusion

#64
post #60

Earlier quoted context omitted.

Because the value, as presented, is wrong. "[but it's being used for] non-scientific, non-metrological purposes" which doesn't change that it's the wrong value. Imagine, for a moment, that someone uses these values to put up a fence. Is the fence on their property? Those crap values beyond the actual significant digits of the measurement may tell you that you are, when you're not. That will cost you time and money do…

These values are as right as setting least significant digits to 0 would be. The sensor has limited precision and the other digits might as well be 0 or 584985948 and the value would be no more precise.

I believe you're wrong.

https://en.wikipedia.org/wiki/Significant_figures

Re: The lat/lon floating point delusion

#65
post #58

People have this idea that when you take a measurement, you have so-and-so number of significant figures that are probably correct and the rest are just pure noise. But that's not how measurement error works. In the real world, physical measurement errors are more-or-less normally distributed (we don't have to argue about the "more-or-less" part because my argument here holds for any distribution other than a uniform…

The problem is that these lat/lon figures are not displayed with precision information at all, so we can't even know the std dev. Sig figs are a simple and clear way to communicate the precision of a measurement, but if you want to be more statistically accurate, you can use parentheses to indicate the standard deviation. In your example (if I mess this up please correct me, but I think) it would be 45.73490534578(1000000)° Which again is silly because there is no way to know the standard deviation to that level of precision. A more reasonable number would be 45.734905(10)°

Is it difficult to include precision when reporting measurements? No

Is it sometimes valuable? Yes

Is it really too much to ask for? No

Re: The lat/lon floating point delusion

#66
post #16

Earlier quoted context omitted.

The representation of the numbers doesn't convey any information about accuracy, and it's at least a good practice to store data in a way that conveys the precision it was gathered with.

The issue then is that there is no reasonable primitive format to store a “real number with a small decimal precision”. Arguably storing these as ints would be better but then everybody would need to agree on the denominator.

It is frustrating (to me, at least) that there is no common primitive data type the stores precision. But it isn't rocket surgery to store two floating-points (a value and precision) in a structure and format it properly for display.

Re: The lat/lon floating point delusion

#67
post #21

Does anyone here know what's the actual precision that we can get by the available equipment?

Survey-grade GPS (using CORS and WAAS correction) using RTK will give you accuracy to ~10 cm within a few seconds. You can get that down to several millimetres if you can tolerate post-processing several hours worth of static data.

It's true. But survey-grade coordinates generally are used in a universal transverse Mercator, or in some locales a Lambert conic or some other locally useful projection. Those projections take into account such things as the deviation of the earth's shape from a perfect sphere.

Rule about lat/long precision: If somebody says the words "datum" or "projection" to you, and you say "huh?", then you only need four digits after the decimal point in your lat/long coordinates. On the other hand, if you're designing an outdoor parking lot and you don't want puddles, please use survey-grade coordinates.

Re: The lat/lon floating point delusion

#68

Yes, why don't people spend their time doing the extra work to figure out the exact number of meaningful digits in their measurements when the defaults work just fine for their non-scientific, non-metrological purposes? A mystery for the ages.

Because the value, as presented, is wrong. "[but it's being used for] non-scientific, non-metrological purposes" which doesn't change that it's the wrong value. Imagine, for a moment, that someone uses these values to put up a fence. Is the fence on their property? Those crap values beyond the actual significant digits of the measurement may tell you that you are, when you're not. That will cost you time and money do…

That is a misunderstanding of floating point.

The relationship between trailing non-zero digits in the decimal representation and trailing non-zero bits in the significand is not one-to-one.

One third in a trinary representation would be 0.1. In decimal, 0.33333333333...

Mostly fruitless overprocessing. Only time I'd consider doing this would be for an epic ASCII dump of coordinates.

Re: The lat/lon floating point delusion

#69
post #62
post #3

Not 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.

Here in the frozen north, newpapers^H^H^H^H^H^H sites insert metric conversions everywhere. “I must have lost ten pounds [4.5359237 kg] on that run!”

I absolutely love it when I read something like "The object was nearly 1 foot (30.48 cm) long."

Re: The lat/lon floating point delusion

#70
post #45

Yes, why don't people spend their time doing the extra work to figure out the exact number of meaningful digits in their measurements when the defaults work just fine for their non-scientific, non-metrological purposes? A mystery for the ages.

Significant-digits seem like schoolroom drudgery until, one day, there is enlightenment.

They're a useful tool, no more, no less.

Using a useful tool to do something useless doesn't make the useless thing useful.

Sometimes significant digits are too primitive a tool for error communication, and you might have to use the parameters of a normal distribution, some other distribution, or even a histogram. Other times significant digits are too cumbersome because it would take time to discover the precision in a situation where nobody actually cares beyond a crude threshold. This is one of those other times.

Post reply on HN