[gdal-dev] Is it possible to switch warnings off?
Joaquim Manuel Freire Luís
jluis at ualg.pt
Sun Mar 7 14:42:05 PST 2021
Thanks Even e Mateusz
It is the same gdal lib in both cases. The only other one I have is sheltered in OSCeo4W.
And I had found where the messages are coming from but it's weird that they are printed in one case and not the other. I guess some internal setting that doesn't get set when called via Julia.
I'll explore the CPLPushErrorHandler()
Joaquim
From: Even Rouault <even.rouault at spatialys.com>
Sent: Sunday, March 7, 2021 10:15 PM
To: Joaquim Manuel Freire Luís <jluis at ualg.pt>; gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Is it possible to switch warnings off?
Joaquim,
I suspect you are not testing with the same GDAL version with your gdalinfo shell invokation or within julia.
With the C API, you can shut down warnings and errors with
CPLPushErrorHandler(CPLQuietErrorHandler);
...
CPLPopErrorHandler();
You can install a custom error handler that filters only some category of events. See
https://gdal.org/api/cpl.html?highlight=cplpusherrorhandler#_CPPv419CPLPushErrorHandler15CPLErrorHandler
Even
Le 07/03/2021 à 21:42, Joaquim Manuel Freire Luís a écrit :
Hi,
I have this strange case where some warnings come from don't know where.
>From a shell command (cmd but it doesn't matter) all fine
gdalinfo AQUA_MODIS.20020717T135006.L2.SST.nc
Driver: netCDF/Network Common Data Format
Files: AQUA_MODIS.20020717T135006.L2.SST.nc
Size is 512, 512
Metadata:
/navigation_data/NC_GLOBAL#gringpointlatitude={28.923635,25.633446,42.81229,46.942131}
...
However, the same but this time called from Julia that wraps calls to
options = GDALInfoOptionsNew(options, C_NULL)
result = GDALInfo(ds.ptr, options)
GDALInfoOptionsFree(options)
I get these warnings
julia> println(gdalinfo("AQUA_MODIS.20020717T135006.L2.SST.nc"))
Warning 1: The dataset has several variables that could be identified as vector fields, but not all share the same primary dimension. Consequently they will be ignored.
Warning 1: The dataset has several variables that could be identified as vector fields, but not all share the same primary dimension. Consequently they will be ignored.
Driver: netCDF/Network Common Data Format
Files: AQUA_MODIS.20020717T135006.L2.SST.nc
Size is 512, 512
Metadata:
/navigation_data/NC_GLOBAL#gringpointlatitude={28.923635,25.633446,42.81229,46.942131}
...
Also get several of these in other commands
Warning 1: dimension #1 (pixels_per_line) is not a Longitude/X dimension.
Warning 1: dimension #0 (number_of_lines) is not a Latitude/Y dimension.
Is there anyway to shut up this warnings, or warnings in general?
Thanks
Joaquim
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210307/a46583e1/attachment.html>
More information about the gdal-dev
mailing list