[mapserver-users] Possible bug with 3.5 code w/ Proj 4

Frank Warmerdam warmerdam at pobox.com
Mon Nov 19 21:12:16 EST 2001


Scott Shealy wrote:

> I am stumped... is this a bug?... Am I doing something wrong.? I need the 
> projection stuff to work and I need to do it this way b/c I am using the 
> mapscript interface in a java project.  But when testing I ran into this 
> problem so I pulled the java stuff out of the equation by writing test.c 
> above to isolate the problem ... BTW I have got the mapscript interface 
> working in java and I am planning to post to the mailing list how I did that 
> as soon as the project is complete(deadlines are looming and I am working 65 
> hrs a week ... or I would do it now!)
> 
> Any help is greatly appreciated...
> 
> BTW we have been using mapserver for about 2 weeks and we LOVE IT!!!!


Scott,

I encountered exactly the same problem.  It turns out that mapObj includes
a projectionObj, but the size of projectionObj (in mapproject.h) changes
depending on whether USE_PROJ is defined or not.  USE_PROJ is consistently
defined for all the regular MapServer components by the makefile, but your
mainline build did not define this symbol, and so projectionObj was smaller
and all the alighnment of stuff in mapObj was screwed up in your mainline.

Steve ... I would suggest we change projectionObj to look like this:

typedef struct {
  char **args; /* variable number of projection args */
  int numargs; /* actual number of projection args */ 
#ifdef USE_PROJ
  projPJ proj; /* a projection structure for the PROJ package */

#else
   void   *proj; /* dummy place holder */


#endif
} projectionObj;

instead of this:

typedef struct {
  char **args; /* variable number of projection args */
  int numargs; /* actual number of projection args */ 
#ifdef USE_PROJ
  projPJ proj; /* a projection structure for the PROJ package */
#endif
} projectionObj;

This change will ensure that projectionObj is always the same size

reguardless of whether USE_PROJ is defined for a given build.  What
do you think?

Scott ... your fix is to just build with -DUSE_PROJ on the commandline.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the mapserver-users mailing list