Michael Speth and i are in the process of fixing the PROJ.4 implementation of the HEALPix map projection (see http://trac.osgeo.org/proj/browser/trunk/proj/src/PJ_healpix.c for the current buggy implementation) and are running into some difficulties in the ellipsoidal case.
Here's the issue. We've implemented the spherical version of the HEALPix forward projection via
FORWARD(s_healpix_forward); /* sphere */ return healpix_sphere(lp, P); }
and that works fine. We now want to reuse healpix_sphere() in the ellipsoidal version of the HEALPix forward projection by simply replacing latitude
lp.phi with authalic latitude and replacing the ellipsoid
P with its authalic sphere. What's the best way to do this in PROJ.4?
FORWARD(e_healpix_forward); /* ellipsoid */ lp.phi = auth_lat(lp.phi, P->e, 0); P->a = auth_radius(P->a, P->e); P->e = 0; return healpix_sphere(lp, P); }
where auth_lat() and auth_radius() are our homemade authalic latitude and radius functions. But the numbers coming out aren't correct. We think that our attempt at changing P into its authalic sphere via the P->a and P->e assignments is failing. Any tips?
Michael also asked this question on the PROJ.4 forum (http://lists.maptools.org/pipermail/proj/2012-November/006465.html) last week but hasn't received a response.
Thanks for your attention.