On Proj4...
bruce_esrican
bdodson at e...
Fri Aug 9 18:54:43 EDT 2002
Hi Paul,
I didn't see any followup on this. Has the discussion moved to
another forum? I'm interested in a version of PROJ.4 without all
those macros confusing the issue. However after you're done you'll
probably see opportunities to refactor the common boilerplate code,
without resorting to macros. For example, in a C++ implementation
the boilerplate could make its way into a base class.
strtod shouldn't be a problem since it is part of most C libraries
and is probably not used. If it IS used (e.g. to ensure portability
through a consistent implementation), it can be replaced easily with
another implementation based on sscanf.
Regards,
Bruce
--- In gdal-dev at y..., "Paul Selormey" <paul at t...> 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?
>
> 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!) :(
>
> 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.
>
> Best regards,
> Paul.
More information about the Gdal-dev
mailing list