[MAPSERVER-USERS] msProcessProjection(): Projection library error.

Tamas Szekeres szekerest at gmail.com
Mon Mar 3 19:29:17 EST 2008


2008/3/4, Frank Warmerdam <warmerdam at pobox.com>:

>
>  The "no system list" message just means that PROJ was built without support
>  for strerror() - that is HAVE_STRERROR was not defined in the configure.
>  This seems to happen almost all the time (perhaps a problem in the proj
>  configure).
>
>         char *
>  pj_strerrno(int err)
>  {
>      static char note[50];
>
>      if (err > 0)
>  #ifdef HAVE_STRERROR
>          return strerror(err);
>  #else
>      {
>          sprintf(note,"no system list, errno: %d\n", err);
>          return note;
>      }
>  #endif
>      else if (err < 0) {
>          int adjusted_err = - err - 1;
>          if (adjusted_err < (sizeof(pj_err_list) / sizeof(char *)))
>              return(pj_err_list[adjusted_err]);
>          else
>          {
>              sprintf( note, "invalid projection system error (%d)",
>                       err );
>              return note;
>          }
>      } else
>          return NULL;
>  }
>

Frank,

I understand your point about HAVE_STRERROR, but it seems to be quite
unrelated. Is pj_errno = 22 definitely a proper value? I think the err
> 0 is an abnormal case since the proj library normally generates
negative error codes.

I think someday we should also audit proj to be more thread safe as
using thread locals instead of global variables or doing internal
locks instead of a global lock in the external libraries.

Proj is used so frequently that it would be quite inefficient to
increase number the locks around it  in mapserver.

Best regards,

Tamas


More information about the mapserver-users mailing list