[Proj] Finnish KKJ in proj 4.4.9 - Linux vs. Windows

Roger Oberholtzer roger at opq.se
Tue Jan 3 05:11:21 PST 2006


On Wed, 2005-12-14 at 15:44 +0100, Roger Oberholtzer wrote:

> 
> I have sorted out using proj 4.4.9 to obtain KKJ X/Y values from WGS84
> LAT/LONG values.
> 
> To be more precise, I have this sorted out on Linux. I compiled the same
> 4.4.9 code on Windows using MS VC++ 6.0 and the makefile.vc in the proj
> source. The problem is that I do not get the same results on the two
> systems! The error is in the neighborhood of 100 meters.
> Has anyone used proj on Windows and had any such problem? I have used
> other similar libraries on both platforms before, so I did not expect
> this.
> 
> I was thinking of trying the 4.4.6 binary that is available for
> downloads, but it does not contain a proj.lib file, making linking
> problematic. Any reason there is not a windows binary of 4.4.9, and only
> of 4.4.6?


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:

Columns 1 and 2 are the X/Y that an external reference system (customer)
claims the values should be.

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.

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.

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.

The PROJ command used on both Linux and Windows is:

Initialization:

    pj_init_plus("+proj=latlong +ellps=WGS84");

    pj_init_plus("+init=esri:2393");

Calculation:

    set lng and lat to the location in radians, then:

    pj_transform(fromProj, toProj, 1, 0, &lng, &lat, &alt):

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.

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?

I would imagine that the altitude value is not used? Right?

The 'esri' file is the same on both platforms. It is the one that comes
with proj.

Any ideas (other than tell the users to do this on a Linux platform for
best results)?

-- 
Roger Oberholtzer
OPQ Systems AB

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20060103/11dd5158/attachment.html>
-------------- next part --------------
6678774.88 3382686.20 6678774.91071 3382686.80341 6678748.55278 3382628.51448 6012.21644 2452.87822      
6678780.97 3382679.04 6678781.00476 3382679.65336 6678754.64711 3382621.36416 6012.21959 2452.87027      
6678783.49 3382669.19 6678783.52215 3382669.79620 6678757.16460 3382611.50653 6012.22078 2452.85953      
6678782.96 3382659.07 6678782.98758 3382659.67969 6678756.63002 3382601.38955 6012.22032 2452.84861      
6678779.22 3382649.53 6678779.25745 3382650.13852 6678752.89974 3382591.84793 6012.21814 2452.83842      
6678773.75 3382641.12 6678773.78035 3382641.72293 6678747.42243 3382583.43195 6012.21505 2452.82952      
6678767.34 3382633.48 6678767.36189 3382634.08617 6678741.00371 3382575.79484 6012.21147 2452.82148      
6678760.84 3382625.97 6678760.86123 3382626.57741 6678734.50279 3382568.28572 6012.20784 2452.81359      
6678754.28 3382618.42 6678754.30908 3382619.02314 6678727.95037 3382560.73110 6012.20418 2452.80565      
6678748.06 3382610.77 6678748.09408 3382611.37745 6678721.73512 3382553.08505 6012.20070 2452.79760      


More information about the Proj mailing list