[Proj] .NET / C# port of proj4

Jason Askew jason.askew at gmail.com
Wed Jun 7 13:45:43 PDT 2006


I am 10 hours into a C# / .NET port of proj4.

My current focus is getting one specific function to work, that being
pj_transform from pj_transform.c

I am at the point now that I'm dealing with PJ_GRIDINFO and
pj_apply_gridshift and other such matters.

Kinda of a top down approach, if you will.

This is not my first C to C# conversion but is definately by far the
most challenging.

Anyway, I have questions.  As this will probably be the first post of
many, I'm going to use .NET / C# as the start of all my subjects lines
to keep a common format for this topic going.

Most questions should be about the logic or concepts behind the project.

So, question one:

In file: pj_transform.c

projected_loc is defined as so:

XY         projected_loc;

XY being defined as:

typedef struct { double x, y; }     XY;

buy then later in pj_transform.c, u and v members show up in
pj_transforms.c, like so:

                    projected_loc.u = x[point_offset * i];
                    projected_loc.v = y[point_offset * i];

I must be missing something painfully obvious.  I see the defines
wrapped around the def of the XY struct, i.e.:

#ifndef PJ_LIB__
#define XY projUV
#define LP projUV
#else
typedef struct { double x, y; }     XY;
typedef struct { double lam, phi; } LP;
#endif

but PJ_LIB__ is defined.

Not to mention pj_inv and pj_inv expect the XY for and not the projUV form.

I must be missing something obvious.

Jason



More information about the Proj mailing list