[Proj] rHEALPix new parameters

Michael Speth spethm at landcareresearch.co.nz
Tue Nov 1 12:23:33 PDT 2011


Greetings,
   I've updated the code to use pj_ctx_set_errno.  Thanks!  What is the 
command line flag for displaying the error code/error string?

Thanks

On 01/11/11 09:45, Frank Warmerdam wrote:
> 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,


-- 
Michael Speth
Scientific Programmer
Landcare Research

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20111102/ab6acd7a/attachment.html>


More information about the Proj mailing list