[GRASS5] problems with [rsv].proj

Morten Hulden morten at ngb.se
Thu May 30 05:43:27 EDT 2002


On Thu, 30 May 2002, Glynn Clements wrote:

> Done. The following patch produces the "desired" result (i.e. the way
> that pseudo-cylindrical world maps normally look in illustrations),
> but is it the right thing to do?
> 
> diff -u -r1.2 PJ_urmfps.c
> --- src/libes/proj/PJ_urmfps.c	20 Apr 2002 19:13:44 -0000	1.2
> +++ src/libes/proj/PJ_urmfps.c	30 May 2002 04:30:08 -0000
> @@ -17,8 +17,12 @@
>  }
>  INVERSE(s_inverse); /* sphere */
>  	xy.y /= P->C_y;
> +	if (fabs(xy.y) > HALFPI)
> +		I_ERROR
>  	lp.phi = aasin(sin(xy.y) / P->n);
>  	lp.lam = xy.x / (C_x * cos(xy.y));
> +	if (fabs(lp.lam) > PI)
> +		I_ERROR
>  	return (lp);
>  }
>  FREEUP; if (P) pj_dalloc(P); }
> 
> If it is, instinct suggests that the same issue will apply to many
> (most?) of the projections, not just Wagner I.

But these are changes to proj, not to grass. You should take them up on 
the proj mailing list and try to get them accepted there, otherwise we'll 
soon be out of sync with the proj code.

I was thinking of a more general solution: catch the x & y return values 
from pj_do_proj ín main.c just before r.proj goes into the 'readcell'
routine, and just loop if x or y are not correct.

In the command line application proj returns a star symbol (*) for 
lon or lat if you try to project a point outside the bounding ellipse in 
a pseudo-cylindical projections. Should be possible to catch that 
situation in [rsv].proj.

Morten Hulden
 




More information about the grass-dev mailing list