[OSRS-PROJ] On Proj4...
Frank Warmerdam
warmerdam at pobox.com
Thu May 30 09:51:56 EDT 2002
Paul Selormey wrote:
> Hello All,
> As I have stated earlier, I am working to remove all the macros style codes
> to a more readable version of the projection library.
>
> With the exception of the PROJ_HEAD in the pj_list.h file, I have completed
> the removal from all other files. I am not removing the constants.
>
> I have found two problems and need some help...
>
> 1. One file strtod.c is a GPL code. Is the Proj4 therefore not under GPL?
> and other libraries using it?
Paul,
This is a mistake on my part. I will submit a bug (149) to myself to come up
with another strod() implementation with appropriate license constraints or
to rewrite my own version.
Note that the strtod() code is LGPL, but by statically linking it into PROJ.4
I am effectively placing all of PROJ.4 under LGPL.
> 2. One file biveval.c still contains one pre-ANSI C function.
>
> /* basic bivariate Chebyshev evaluation */
> static double ceval(C, n) struct PW_COEF *C;
> {
> ....
> }
>
> what is the right ANSI version of this function. I could not get this right
> (it seems the "n" is an integer!) :(
As far as I know it should be:
static double ceval( struct PW_COEF *C, int n);
Apparently in K&R C untyped arguments were implicitly integers.
> I will post the final codes for all to evaluate and then start work on
> porting to C++.
> I know many will still prefer this
>
> ----------------------------------------------------------------------------
> -----------
> ENTRY0(leac)
> P->phi2 = pj_param(P->params, "rlat_1").f;
> P->phi1 = pj_param(P->params, "bsouth").i ? - HALFPI: HALFPI;
> ENDENTRY(setup(P))
> ----------------------------------------------------------------------------
> ----------
>
> to this:
>
> ----------------------------------------------------------------------------
> ---------
> const char * const pj_s_leac = des_leac;
>
> PJ *pj_leac(PJ *P)
> {
> if (!P)
> {
> if( (P = pj_malloc(sizeof(PJ))) != ((void *)0))
> {
> P->pfree = freeup;
> P->fwd = 0;
> P->inv = 0;
> P->spc = 0;
> P->descr = des_leac;
> }
> return P;
> }
> else
> {
> P->phi2 = pj_param(P->params, "rlat_1").f;
> P->phi1 = pj_param(P->params, "bsouth").i ? - HALFPI: HALFPI;
> }
> return (setup(P));
> }
> ----------------------------------------------------------------------------
> --------
>
> However, the macro-free version will make it earsier to port the library to
> C++/Java/C# etc
> and that is my goal.
I understand your rationale but I don't think I will incorporate your "expanded
macros" version into the core, even though I too find the macros sometimes
obscure what is going on from the casual developer.
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
----------------------------------------
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.
More information about the Proj
mailing list