Re: Silencing PROJ errors/warnings


Sean Gillies
 

Hi Greg,

On Fri, Mar 27, 2020 at 12:29 PM <gberardinelli@...> wrote:
Hi all,

As of GDAL 3 I've started seeing warnings written to stderr on open, such as:

proj_create_from_database: datum not found
It's possible that these datasets have malformed projection information, but in cases where I don't care I'd like to be able to silence these types of warnings, as they can easily be emitted hundreds of times.  However I can't find a way to do so.

Using an Env() context with CPL_DEBUG set to os.devnull has no effect, nor does redirecting sys.stderr itself.  It also doesn't look like this is being emitted through the logging module.  So it seems like the underlying library itself may be writing to stderr?  I don't know if this is a rasterio issue, a gdal issue, or a proj issue.

Any pointers are appreciated.

Greg

Do you see a bare "proj_create_from_database: datum not found" or do you see
ERROR 1: PROJ: proj_create_from_database: datum not found
as in https://github.com/OSGeo/gdal/issues/2321?

Which specific GDAL version are you using?

--
Sean Gillies

Join main@rasterio.groups.io to automatically receive all group messages.