[Proj] rHEALPix new parameters

Frank Warmerdam warmerdam at pobox.com
Mon Oct 31 15:45:19 EST 2011


On Mon, Oct 31, 2011 at 1:31 PM, Michael Speth
<spethm at landcareresearch.co.nz> wrote:
> Hi Frank,
>   There are 4 errors that I want to generate which are only in the inverse
> projections and not the forward.  However, the E_ERROR directive seems to
> only work in the ENTRY and SETUP functions (because it returns an int).
>
> From looking at proj.c, the forward or inverse functions are called after
> the setup code which includes the ENTRY0; I think that I am unable to check
> in the ENTRY0 directive for the error conditions for inverse projections.
> Is this correct?
>
> So should I use the I_ERROR directive in this case?  If so, it doesn't seem
> to allow for entering errno values (its defined as -20).  Can I create a new
> directive similar to E_ERROR(err) but for I_ERROR?

Michael,

I would actually encourage you to actually explicitly call
the error code instead of using the opaque I_ERROR
or a similar macro.  For instance in PJ_tmerc.c I now do:

        /*
         * Fail if our longitude is more than 90 degrees from the
         * central meridian since the results are essentially garbage.
         * Is error -20 really an appropriate return value?
         *
         *  http://trac.osgeo.org/proj/ticket/5
         */
        if( lp.lam < -HALFPI || lp.lam > HALFPI )
        {
            xy.x = HUGE_VAL;
            xy.y = HUGE_VAL;
            pj_ctx_set_errno( P->ctx, -14 );
            return xy;
        }

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 Software Developer


More information about the Proj mailing list