[Proj] NAD problems on OSX 10.5 Leopard

Frank Warmerdam warmerdam at pobox.com
Tue Jan 15 23:42:12 EST 2008


William Kyngesburye wrote:
> I poked around to try to understand it better.  The lam/laml/phi/phil 
> that are longs, appear to be only used in reading the text source 
> lla's.  The CTABLE that is written in binary form uses only doubles, 
> floats and ints, which don't change between 32 and 64bit OSX.  At least, 
> the number of bytes used doesn't change - would the binary format be 
> different?  That doesn't make sense.
> 
> Comparing the binary files, on 64bits and 32bits, Tiger and Leopard:
> 
> 64bit-Leo file
> 32bit-Tiger file
> 32bit-Leo file
> 
> The headers are all exactly the same - the ints and doubles for the 
> lower-left coord, cell size, and grid size match in all files.  The 
> floats for the conversion matrix don't match, immediately.  There are 4 
> bytes in the 32bit files, and 8 bytes in the 64bit files, before the 
> matrix that I can't account for.  After that the matrixes of floats 
> match.  The calculated size of the matrix from the grid size matches the 
> byte count after those mystery bytes.

William,

I believe the difference is in alignment within the structure between
32bit and 64bit systems.  Because the memory image of the structure is
dumped to disk, the file access is very sensitive to differences in
how fields are packed into structures in memory.  This can vary based
on many things.

Really, my preference would be to completely get rid of nadcon style
binary files in favor of NTv1 or NTv2 style files which are platform
independent but doing so would require more work than I'm willing
to invest at this time.

In the meantime, I imagine it would not be too hard to alter the nadcon
reading and writing functions to use some sort of consistent binary
file.  But I'm even to lazy to attempt that just now.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the Proj mailing list