[OSRS-PROJ] One more help, please...

Paul Selormey paul at toolscenter.org
Mon Jun 10 06:45:16 EDT 2002


Hello All,
Please help me resolve this macro issue in the Proj4 library:

The PJ struct defines its main members and adds macros for
the individual projections to extend it: the PROJ_PARMS__ below:
(in the projects.h file)

typedef struct PJconsts
{

        .........

#ifdef PROJ_PARMS__
PROJ_PARMS__
#endif /* end of optional extensions */
} PJ;

To this those projections with extra parameters define these as (example):

#define PROJ_PARMS__ \
 double cosphi1; \
 int  mode;
#define PJ_LIB__

#include "projects.h"

These extra members are therefore not available in the interface exposed
by the library. Unfortunately! I wish to get rid of this macro too and I
have
two options:

1. Define global structures in the individual files to hold the extra
parameters with
   a declared global variable each:

 struct foo
 {
      double cosphi1;
     int       mode;
 };

static foo gExtra;

2. Add a long type variable to the PJ to hold pointer to use-defined extra
structures:

typedef struct PJconsts
{

        .........

    long lUserParameter;
} PJ;

The user parameters can then be created from some define structures and with
pointer
saved in the lUserParameter member.

Which is better and why? (I need your views on your preference). Do you have
better
solution to this problem? (please outline it).

Best regards,
Paul.


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



More information about the Proj mailing list