[Proj] NAD problems on OSX 10.5 Leopard

William Kyngesburye woklist at kyngchaos.com
Tue Jan 15 21:00:28 EST 2008


This is an odd one.  On OSX 10.5 (Leopard), as a 64bit binary PROJ/ 
cs2cs correctly translates betwen NAD27 and NAD83.  But, as a 32bit  
binary it translates in the opposite direction.  The OSX 10.4 (Tiger)  
build (32bits-only) also correctly translates datums (ie, it's the  
same as the 64bit translation).

$ cs2cs +proj=latlong +datum=NAD27 +to +proj=latlong +datum=NAD83
-118 38
118d0'3.385"W	37d59'59.751"N 0.000

$ arch -i386 cs2cs +proj=latlong +datum=NAD27 +to +proj=latlong  
+datum=NAD83
-118 38
117d59'59.748"W	38d0'3.385"N 0.000


The Tiger binary, even running on Leopard gets the translation  
correct, so I wonder if something is happening in the compilation.

long's can be trouble, since on 32bit OSX they are 32bit, but on 64bit  
OSX they are 64bit.  Looking at nad2bin (and a few library sources), I  
see that longs are used in the NAD tables (lam and phi), so the NAD  
binary files are getting built with 64bit longs, then the 32bit PROJ  
is trying to read 32bit longs.

Are the NAD tables meant to always be 64bit longs?  Should long long  
be used instead, to guarantee 64bit longs, or maybe they should be  
configured?


-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

All generalizations are dangerous, even this one.




More information about the Proj mailing list