[Proj] C# / .NET questions - mainly file loading

Jason Askew jason.askew at gmail.com
Fri Jun 9 00:38:44 EDT 2006


Just want to verify I have some logic correct:

pj_open_lib -

This just uses some logic to search for a file in different areas.

pj_gridinfo_init -

Checks the header.  There are three possible file types:

pj_gridinfo_init_ntv1 - ntv1
pj_gridinfo_init_ntv2 - ntv2
nad_ctable_init - ctable

Correct?

As a side note, are there solid docs on the format of each type?

I have done some research, concerning ntv2, from:

http://jgridshift.sourceforge.net/ntv2.html

The NTv2 spec does not specify big-endian or little-endian format for
binary files (the most commonly available). Canada opted for
big-endian, Australia for little-endian. To make matters worse the
first version of 'Australian' format files used a different record
length for some headers. Subsequently Australian binaries were
produced as strict little-endian versions of the Canadian file format.

Is there any compensation for this?  Looking at the code, it seems
that there is compensation for the system being big or little endian,
but not the file format itself?.

Additionally, I've found ntv2 in both binary and asc format...  how is
this handled?

I'm just not finding much info about ntv1, either.

And ctable... well, I'd like a good pointer on what this is about,
too.  This ends up being the default.  I've gone back and looked at
the mailing history, but I'm not finding what I'm seeking.

So...  ok, any help with the file formats would be good.

I can copy the current code functionality verbatim, but I would really
like to understand what I am copying.

Again, thanks.

Jason



ps,  I really enjoyed this:

static int  byte_order_test = 1;
#define IS_LSB	(((unsigned char *) (&byte_order_test))[0] == 1)

Cool.


More information about the Proj mailing list