[Proj] Numerical Precision in Proj, WKT, and everywhere

Craig Bruce csbruce at cubewerx.com
Thu Apr 1 19:42:25 EST 2010

"Gerald I. Evenden" <geraldi.evenden at gmail.com> wrote:

> Au contraire. When you have a number with few significant figures that have 
> trailing zeroes such as "0.999600....000" any format that has sufficient 
> width to contain the significant figures will preserve the significance. 
> There is no rounding nor trucation problem.

Obviously, but I'm not talking about specific values that happen to
be round.

> The only hassle occurs when the the fractions are irrational such as pi,
> then there is a problem.

There's also a problem with rational fractions, like 1/60, as I showed
in the WMS example.  You can easily write x = 1/60.0 in a program get a
fully precise value for whatever representation you are using, but you
can't put this expression on the proj command line (AFAIK).

> But in these situations (and probably others) the continual bouncing
> back and forth between decimal and binary should be avoided. I strongly
> suspect that there is no good reason for it anyway.

I agree that it's best to avoid unnecessary conversions, but there are
many interfaces that require text, such as the proj command-line or OGC
web interfaces.  The same issue occurs with the database/application
interface with BCD.  We are forced to obey the interfaces of the various
systems we wish to chain together.

Dr. Craig S. Bruce        | Ph 819-771-8303 x205 |             CubeWerx Inc.
Senior Software Developer |   Fax 819-771-8388   |  Gatineau, Québec, Canada
csbruce at cubewerx.com      |  http://csbruce.com/ |  http://www.cubewerx.com/
  "Committee, n.: A group of people that, when given the task of deciding
  whether to start array indices from either 0 or 1, compromises to declare
                that they shall start from 0.5." -- unknown

More information about the Proj mailing list