7 ms·
Did the author think about the implementation? If we assign semantic meaning to the number of decimal points, now we also need to store the number of significan
by krapht 7y ago
Did the author think about the implementation? If we assign semantic meaning to the number of decimal points, now we also need to store the number of significant digits side by side with the actual number. We shouldn't round off internally because we might use it in as an intermediate result in a calculation.
- harryh 7y agoYou don't need to store anything extra if you are just filtering down to a standard number of digits on output.
- vonmoltke 7y ago> 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.
- whatshisface 7y agoError 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.
- Luc 7y agoWhich calculation on lat/lon coordinates would make an atom-scale error grow, say, a million times to millimeter-size?
- Majromax 7y agoWhat numerically unstable algorithms are ever performed with geolocations? Moreover, given the author's point that real measurement errors exceed the false precision of published data, if such a calculation were performed and did provide "arbitrarily large" error, it would indicate that the result should in fact be nonsense.
- whatshisface 7y agoI'm thinking about the case where a calculation extends across many roundings.
- Majromax 7y agoThat doesn't necessarily make the algorithm unstable. See for example: >>> import numpy as np >>> x0 = np.random.rand(1) >>> x_rnd = np.round(100*x)/100.0 >>> for i in range(1000): ... x = np.mod(x+np.pi,1) ... x_rnd = np.mod(x_rnd + np.pi,1) ... x_rnd = np.round(100*x)/100 ... >>> x_real = np.mod(x0+1000*np.pi,1) >>> print(x_real,x,x_rnd) (array([0.51013166]), array([0.51013166]), array([0.51])) Note no loss of accuracy for all of the intermediate roundings. The accuracy is preserved because there's no mechanism here to amplify the error. That's why I ask about the kind of algorithms typically applied to geolocated data. Off the top of my head, I can't think of anything that would be both useful and error-amplifying.
- jhayward 7y agoVincenty's formula has some instabilities/failure to converge at certain areas of the globe. [1] https://en.wikipedia.org/wiki/Vincenty%27s_formulae https://en.wikipedia.org/wiki/Vincenty%27s_formulae
- caf 7y agoIf you're doing calculations with geographical co-ordinates that are so unstable that a nanometre position difference in the original makes an arbitrarily large difference in the result, your results aren't sensible anyway.
- scblock 7y agoI would consider storing (as part of the database) or defining (as part of the display code) the number of significant digits for coordinates part of good GIS design.
- dariusj18 7y agoIt would be nice to see a cloud of possibility around the map marker, similar to how your own "I am here" dot has when your phone doesn't have a good fix.