[OSRS-PROJ] problem with nad_init and initializing ntv1_can.dat
Charles Seaton
cseaton at ccalmr.ogi.edu
Wed Nov 19 18:50:16 PST 2003
Hello all,
Perhaps someone here can help.
Previously, I have used the proj C library version 4.4.5 on an SGI irix
machine without difficulties. However, I have recently installed
proj4.4.7 on an intel i386 Linux machine. When I attempt to run this
piece of C code (which works using proj v4.4.5):
#include <string.h>
#include <projects.h>
static struct CTABLE *ctab, *htab, *cantab;
static PJ *cnv_array;
static char *parms[] = {"init=nad27:3601"};
static int n_parm = 1;
static char nad_area[]= "WO",conus[]="conus",canada[]="ntv1_can.dat";
int main (int argc, char **argv)
{
cnv_array = pj_init(n_parm,parms);
if (!(htab = nad_init(nad_area))){
fprintf(stderr,"nad_init for parms failed due to
%s\n",pj_strerrno(pj_errno));
exit(1);
}
if (!(ctab = nad_init(conus))){
fprintf(stderr,"nad_init for conus failed due to
%s\n",pj_strerrno(pj_errno));
exit(1);
}
if (!(cantab = nad_init(canada))){
fprintf(stderr,"nad_init for canada failed due to
%s\n",pj_strerrno(pj_errno));
exit(1);
}
}
I get the error message:
"nad_init for canada failed due to failed to load NAD27-83 correction file"
The files WO, conus, and ntv1_can.dat are located in
/usr/local/share/proj in both systems, and the files are readable by all
users on both systems.
I read the source code for nad_init.c in release 4.4.7, and (unless I am
completely misreading the code) it doesn't appear to support the ntv1
(or the ntv2) formats. Older versions of nad_init.c (version 1.6 and
previous) contained a function nad_load_ntv1, which was called by
nad_init if the header portion of the file did not meet the expected
format. The new version of nad_init.c lacks the nad_load_ntv1 function.
The new version also lacks a function to load ntv2 files (even though it
specifies that it now provides preliminary ntv2 support).
I am wondering if the functions for handling the initialization of the
Canadian datums NTv1 and NTv2 have been moved out of nad_init into some
other function, or whether these functions have somehow been lost. I
have looked through the mailing list archives for any mention of this
problem, and I have not found anything.
Any help that anyone could provide would be greatly appreciated.
Charles Seaton
cseaton at ccalmr.ogi.edu
Research Associate
Center for Coastal and Land Margin Research
Oregon Graduate Institute
Oregon Health and Science University
----------------------------------------
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.
More information about the Proj
mailing list