[Proj] .NET / C# port of proj4

Gerald I. Evenden gerald.evenden at verizon.net
Wed Jun 7 21:18:48 EDT 2006

On Wednesday 07 June 2006 4:45 pm, Jason Askew wrote:
> 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

As the one who started all that, I will take the blame.  In some cases it does 
not matter whether it is geographic or Cartesian data being passed around so 
I used a generic UV name for a reference of material that was identical as 
far as the hardware was concerned.

PROJ_LIB__ (same as old PJ_LIB__) designates that lib_proj.h is being used in 
a projection routine and the the macros defined inside its area are only 
applicable in those routines.

I think PROJ_UV is only used in lproj.c.

Don't worry about it. ;-)

Can't C material be linked to C# software?  If not, pity.
Jerry and the low-riders: Daisy Mae and Joshua
"Cogito cogito ergo cogito sum"
   Ambrose Bierce, The Devil's Dictionary

More information about the Proj mailing list