<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.8.0">
</HEAD>
<BODY>
On Wed, 2005-12-14 at 15:44 +0100, Roger Oberholtzer wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>

<FONT COLOR="#000000">I have sorted out using proj 4.4.9 to obtain KKJ X/Y values from WGS84</FONT>
<FONT COLOR="#000000">LAT/LONG values.</FONT>

<FONT COLOR="#000000">To be more precise, I have this sorted out on Linux. I compiled the same</FONT>
<FONT COLOR="#000000">4.4.9 code on Windows using MS VC++ 6.0 and the makefile.vc in the proj</FONT>
<FONT COLOR="#000000">source. The problem is that I do not get the same results on the two</FONT>
<FONT COLOR="#000000">systems! The error is in the neighborhood of 100 meters.</FONT>
<FONT COLOR="#000000">Has anyone used proj on Windows and had any such problem? I have used</FONT>
<FONT COLOR="#000000">other similar libraries on both platforms before, so I did not expect</FONT>
<FONT COLOR="#000000">this.</FONT>

<FONT COLOR="#000000">I was thinking of trying the 4.4.6 binary that is available for</FONT>
<FONT COLOR="#000000">downloads, but it does not contain a proj.lib file, making linking</FONT>
<FONT COLOR="#000000">problematic. Any reason there is not a windows binary of 4.4.9, and only</FONT>
<FONT COLOR="#000000">of 4.4.6?</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
I have now verified that I am doing the exact same thing on both platforms. I have attached a small amount of test data that demonstrates what I am seeing. The data contains eight columns:<BR>
<BR>
Columns 1 and 2 are the X/Y that an external reference system (customer) claims the values should be.<BR>
<BR>
Columns 3 and 4 are the X/Y that I get with PROJ on Linux. Matches Columns 1 and 2 within acceptable limits. This was my first test of proj that I initially reported and was happy with.<BR>
<BR>
Columns 5 and 6 are the X/Y that I get with PROJ on Windows (MSVC++ 6.0 compiler). Do NOT match Columns 3 and 4, to which they should be almost identical, and also are farther away from reference in Columns 1 and 2.<BR>
<BR>
Columns 7 and 8 are WGS84 lats and longs in minutes. I have verified that both the Linux and Windows calculations are using the exact same values for these. These are the values that all calculations are based on.<BR>
<BR>
The PROJ command used on both Linux and Windows is:<BR>
<BR>
Initialization:<BR>
<BR>
    pj_init_plus("+proj=latlong +ellps=WGS84");<BR>
<BR>
    pj_init_plus("+init=esri:2393");<BR>
<BR>
Calculation:<BR>
<BR>
    set lng and lat to the location in radians, then:<BR>
<BR>
    pj_transform(fromProj, toProj, 1, 0, &lng, &lat, &alt):<BR>
<BR>
The code on both platforms is the same. The utility that is doing this also does other transforms, and these are always the same on both platforms.  So, in a way I do not understand, there is some difference that, by process of elimination, must be in the proj code.<BR>
<BR>
Could there be any constant that proj defines if it is not defined by the system? Like a PI or some other value? So if I have not included some expected system file on the windows platform it could get some different default value?<BR>
<BR>
I would imagine that the altitude value is not used? Right?<BR>
<BR>
The 'esri' file is the same on both platforms. It is the one that comes with proj.<BR>
<BR>
Any ideas (other than tell the users to do this on a Linux platform for best results)?<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Roger Oberholtzer
OPQ Systems AB

</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>