[GRASSLIST:2205] Re: Another problem with r.proj

Glynn Clements glynn.clements at virgin.net
Sat Jul 28 17:56:58 EDT 2001


Glynn Clements wrote:

> >   The first file I'm trying to convert is a map of the PLSS (Public Land
> > Survey System. It _may_ be that the bounds of the PLSS map exceed that of
> > the DEM map. Would that cause r.proj to fail with an error sequence of:
> > 
> > cannot initialize pj
> > cause: projection not named
> > ERROR: Can't get projection key values of output map
> > 
> > ?
> > 
> >   No, that does not appear to be the problem. The module cannot find its
> > pajamas, apparently, but the projection _is_ named in PROJ_INFO:
> > 
> > proj: utm
> > zone: 11
> > ellps: clrk66
> > datum: NAD27
> > 
> >   So, I wonder what "projection key values" it needs but cannot find.
> 
> I'm completely unfamiliar with the projection library; however,
> looking through the code indicates that the issue is this:
> 
> src/raster/r.proj/cmd/main.c calls G_get_projinfo(), which reads
> various projection parameters from the PROJ_INFO file. It then passes
> theses parameters to pj_get_kv(), which does this:
> 
> 	if (strncmp(proj_in, "Lat", 3) != 0) {
> 		if (!(pj = pj_init(nopt1, opt_in))) {
> 			fprintf(stderr, "cannot initialize pj\ncause: ");
> 			fprintf(stderr,"%s\n",pj_strerrno(pj_errno));
> 
> (opt_in is derived from the projection parameters).
> 
> pj_strerrno() indicates that "projection not named" corresponds to a
> pj_errno value of -4. pj_init() will set pj_errno to this value in the
> case:
> 
> 	/* find projection selection */
> 	if (!(name = pj_param(start, "sproj").s))
> 		{ pj_errno = -4; goto bum_call; }
> 
> This suggests that that pj_init() requires the "sproj" parameter to be
> defined, but I can't find anything in GRASS which defines it (the only
> reference which I can find anywhere in the GRASS source tree is the
> one above where pj_init() checks for its existence).

Scratch that; pj_param() interprets "sproj" as type = "s" (string),
name = "proj". It's telling you that the "proj" parameter isn't
defined. As both source and destingation PROJ_INFO files have "proj"
defined, that suggests that it's looking in the wrong place.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-user mailing list