<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I've been struggling since a few days to understand a very odd
behavior with proj.<br>
I have 2 versions of proj libraries and utils, one compiled with
Microsoft Visual C++ 2008 (Express Edition) and another one compiled
with Microsoft Visual C++ 2003.<br>
<br>
Analyzing some strange results in our processes, I found out that
executing some transformations using the two proj libraries return
two (very) different results.<br>
Here is an example of a transformation that is giving me problems
using the cs2cs utility.<br>
<br>
cs2cs -f "%.5f" +proj=tpeqd +a=2440e3 +b=2440e3 +lat_1=-22.960070000
+lon_1=65.546300000 +lat_2=-22.959730000 +lon_2=65.546160000
+no_defs +to +proj=longlat +a=2440e3 +b=2440e3 +lon_0=0 +no_defs<br>
-2385.33232 0.00000<br>
<br>
On the cs2cs compiled with Microsoft Visual C++ 2008 that
transformation returns a meaningful result<br>
65.56780 -23.01227 0.00000<br>
while in the version compiled with Microsoft Visual C++ 2003, it
returns<br>
* * 0.00000<br>
<br>
The same result happens with other (few) sets of coordinates.<br>
Looking at the error returned in the latter case, the pj_transform
exits with error <br>
-19: acos/asin: |arg| >1.+1e-14<br>
<br>
The error happens in the aacos function: in the first case
0.999999999999996 is passed to the function while in the other case
the number passed to the aacos is 1.000000000000012.<br>
<br>
Now, looking (by chance) at the compilation options of the proj, I
noticed that between the options passed to the cl compiler there is
the consistency floating point option " /Op". As stated in the
"Microsoft Visual Floating-Point Optimization" <a
href="http://msdn.microsoft.com/en-us/library/aa289157%28v=vs.71%29.aspx">http://msdn.microsoft.com/en-us/library/aa289157(v=vs.71).aspx</a><br>
<br>
"<span style="color: rgb(0, 0, 0); font-family: 'Segoe UI', Verdana,
Arial; font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
display: inline !important; float: none; ">The consistency model
can seriously reduce efficiency while simultaneously providing no
guarantee of increased accuracy. To serious numerical programmers,
this doesn't seem like a very good tradeoff and is the primary
reason that the model is not generally well received.</span>"<br>
<br>
Disabling that option, the result returned in the version of proj
compiled with Microsoft Visual C++ 2003 is more consistent.<br>
Is there any reason why the /Op option is used to compile the proj?<br>
<br>
Regards,<br>
Calogero<br>
<br>
</body>
</html>