[OSRS-PROJ] lib call results differ from exec results

Gerald I. Evenden gerald.evenden at verizon.net
Mon Jul 14 20:41:53 EDT 2003

Just to beat this dead horse some more:

#include <stdio.h>
#include <stdlib.h>
#include "lib_proj.h"
main(int narg, char **argl) {
	PJ *P;
	XY out;
	LP in;
	char *alist[] = {

	if (!(P = pj_init(6, alist))) {
		printf("proj init failed\n");
	in.lam = atof(argl[1]) * DEG_TO_RAD;
	in.phi = atof(argl[2]) * DEG_TO_RAD;
	out = pj_fwd(in, P);
	printf("%s %s makes %.3f %.3f meters\n",argl[1],
			argl[2], out.x, out.y);

After compiling and executing:

./a.out -110.969 39.7621
-110.969 39.7621 makes -78175.382 -27659.274 meters

Seems to agree pretty well.

On Mon, 2003-07-14 at 20:10, Gerald I. Evenden wrote:
> For local execution of the runline:
> echo "-110.969 39.7621"|./lproj +proj=aea +ellps=clrk66 +lat_1=20
> +lat_2=60 +lon_0=110w +lat_0=40
> -78175.38       -27659.27
> which is a much more reasonable value for a point fairly close
> to the projection origin of -110,40.
> One problem is there is a "," (comma) in the input stream.
> 'lproj' or 'proj' only understand white-space delimiting.
> As for the scanning of "default" file I must admit it was there
> earlier and was always a curse.  Number one question after someone
> installed the system was why it failed---most of the time the
> default file could not be found.  Some setup failure.
> I got rid of it but it still haunts me.
> .
Gerald I. Evenden <gerald.evenden at verizon.net>

PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.

More information about the Proj mailing list