Re: [OpenMap Users] Floats Vs. Doubles

From: Ken Anderson <kanderson@bbn.com>
Date: Thu Dec 04 2003 - 17:40:13 EST

In JScheme, you can do
(define (epsilon x) (if (not (= (+ 1.0 x) 1.0)) (epsilon (/ x 2.0))
to get a quick estimate of floating point epsilon:
> (epsilon 1.0F)
5.9604645E-8F
So, say we have 7 places, and at the equator, one degree is 60 nautical miles, and one nautical mile is 6076 feed. This gives us a float accuracy of
> (* (* 60 6076.0) 1.0e-7)
0.036455999999999995
or 0.44 inches.

Do you really have data that is more accurate than that?

k
At 05:03 PM 12/4/2003 -0500, Don Dietrick wrote:
>Hi Martin,
>
>On Dec 3, 2003, at 11:55 AM, Martin Chapman wrote:
>
>>Don,
>>
>>Why did the architects of OpenMap choose to use floats versus doubles to store point data?
>
>It was a design decision made in 1996, and we chose to save memory over the precision of 7-10 feet, or whatever precision the float gives. It depends on the latitude, but I can't remember exactly what the number is at the equator.
>
>Most of the data sources we dealt with at that time were world-wide databases, and the float accuracy was good enough.
>
>>Sometimes I have a precision problem when plotting geometry on the map because my source data is double value and the coordinates get truncated. This is a problem when dealing with high resolution satellite imagery that requires sub-meter accuracy, which is nine decimal places I think. Do you know how many decimals a float can go to? Is there a way to get around this problem?
>
>Doesn't the number of decimal places depend on the number you are trying to represent?
>
>The only way I know to get more precision is to modify the Projection libraries and OMGraphics to use doubles in addition to floats. Big job.
>
>- Don
>
>--
>[To unsubscribe to this list send an email to "majdart@bbn.com"
>with the following text in the BODY of the message "unsubscribe openmap-users"]

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Dec 4 17:40:52 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:37 EDT