[PROJ] PROJ without proj.db

Kristian Evers kristianevers at gmail.com
Wed Mar 10 00:30:31 PST 2021


No worries, I’m glad you figured it out.

/Kristian

> On 10 Mar 2021, at 09:29, Søren Holm <sgh at sgh.dk> wrote:
> 
> Sorry for the noise Kristian .... turned out that there where multiple 
> contexts and not all of them had the logger function set. Doh!!!
> 
> onsdag den 10. marts 2021 09.22.32 CET skrev Kristian Evers:
>> Sorry, I completely misread that. Well, I guess my analysis is still valid
>> although it doesn’t solve your problem :-)
>> 
>> I am not sure what’s going on then. Which version are you using?
>> 
>> /Kristian
>> 
>>> On 10 Mar 2021, at 09:18, Søren Holm <sgh at sgh.dk> wrote:
>>> 
>>> The function pointer is the third argument. I do indeed set the log
>>> function.> 
>>> onsdag den 10. marts 2021 09.14.34 CET skrev Kristian Evers:
>>>> Here’s the source proj_log_func():
>>>> 
>>>> /************************************************************************
>>>> *** **/ void proj_log_func (PJ_CONTEXT *ctx, void *app_data,
>>>> PJ_LOG_FUNCTION logf) {
>>>> /************************************************************************
>>>> **
>>>> **** Put a new logging function into P's context. The opaque object
>>>> app_data is passed as first arg at each call to the logger
>>>> *************************************************************************
>>>> *** **/ if (nullptr==ctx)
>>>> 
>>>>       ctx = pj_get_default_ctx ();
>>>> 
>>>>   ctx->logger_app_data = app_data;
>>>>   if (nullptr!=logf)
>>>> 
>>>>      ctx->logger = logf;
>>>> 
>>>> }
>>>> 
>>>> So, by putting nullptr as the log function you end up with the default
>>>> logging function. Try setting up an actual logger function and pass a
>>>> pointer to that.
>>>> 
>>>> I can see how you might think that a null pointer would achieve something
>>>> else, though. The docs should clarify that or perhaps the functionality
>>>> should be changed to let logf==nullptr explicitly mean “shut up”. The
>>>> latter is likely the best move based on the fact that if you are happy
>>>> with
>>>> the default logger you probably wouldn’t call proj_log_func() in the
>>>> first
>>>> place.
> 
> 
> -- 
> Søren Holm
> 
> 



More information about the PROJ mailing list