[Proj] .NET / C# port of proj4

Eric Miller EMiller at dfg.ca.gov
Wed Jun 7 16:55:09 PDT 2006


Can't recall if we went over this already, but I wrote a C# wrapper for PROJ.4 that works just fine.  The download address has changed:  http://ftp.dfg.ca.gov/Public/BDB/Tools/proj4/csharp.zip  

I'm currently using it for a projection transform webservice which is working out quite nicely.  Seems like a lot of work to port all that C code to C#.  The macro abuse in PROJ.4 is impossible to replicate in C#.

>>> jason.askew at gmail.com 6/7/2006 1:45:43 PM >>>
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
_______________________________________________
Proj mailing list
Proj at lists.maptools.org 
http://lists.maptools.org/mailman/listinfo/proj





More information about the Proj mailing list