<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-language:PT;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        mso-fareast-language:EN-US;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.highlighted
        {mso-style-name:highlighted;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="PT" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Thanks Even e Mateusz<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">It is the same gdal lib in both cases. The only other one I have is sheltered in OSCeo4W.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I’ll explore the </span><span class="highlighted"><span style="font-size:10.0pt;font-family:"Courier New"">CPLPushErrorHandler()<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="highlighted"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US">Joaquim<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US" style="mso-fareast-language:PT">From:</span></b><span lang="EN-US" style="mso-fareast-language:PT"> Even Rouault <even.rouault@spatialys.com>
<br>
<b>Sent:</b> Sunday, March 7, 2021 10:15 PM<br>
<b>To:</b> Joaquim Manuel Freire Luís <jluis@ualg.pt>; gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> Re: [gdal-dev] Is it possible to switch warnings off?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Joaquim,<span style="mso-fareast-language:PT"><o:p></o:p></span></p>
<p>I suspect you are not testing with the same GDAL version with your gdalinfo shell invokation or within julia.<o:p></o:p></p>
<p>With the C API, you can shut down warnings and errors with<o:p></o:p></p>
<p>CPLPushErrorHandler(CPLQuietErrorHandler);<o:p></o:p></p>
<p>...<o:p></o:p></p>
<p>CPLPopErrorHandler();<o:p></o:p></p>
<p>You can install a custom error handler that filters only some category of events. See
<o:p></o:p></p>
<p><a href="https://gdal.org/api/cpl.html?highlight=cplpusherrorhandler#_CPPv419CPLPushErrorHandler15CPLErrorHandler">https://gdal.org/api/cpl.html?highlight=cplpusherrorhandler#_CPPv419CPLPushErrorHandler15CPLErrorHandler</a><o:p></o:p></p>
<p>Even<o:p></o:p></p>
<div>
<p class="MsoNormal">Le 07/03/2021 à 21:42, Joaquim Manuel Freire Luís a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Hi,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I have this strange case where some warnings come from don’t know where.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">From a shell command (cmd but it doesn’t matter) all fine</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="FR">gdalinfo AQUA_MODIS.20020717T135006.L2.SST.nc</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Driver: netCDF/Network Common Data Format</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="FR">Files: AQUA_MODIS.20020717T135006.L2.SST.nc</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Size is 512, 512</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Metadata:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">  /navigation_data/NC_GLOBAL#gringpointlatitude={28.923635,25.633446,42.81229,46.942131}</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">…</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">However, the same but this time called from Julia that wraps calls to
</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">                              options = GDALInfoOptionsNew(options, C_NULL)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">                              result = GDALInfo(ds.ptr, options)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">                              GDALInfoOptionsFree(options)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I get these warnings</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">julia> println(gdalinfo("AQUA_MODIS.20020717T135006.L2.SST.nc"))</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">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.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">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.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Driver: netCDF/Network Common Data Format</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="FR">Files: AQUA_MODIS.20020717T135006.L2.SST.nc</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Size is 512, 512</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Metadata:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">  /navigation_data/NC_GLOBAL#gringpointlatitude={28.923635,25.633446,42.81229,46.942131}</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">…</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Also get several of these in other commands</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Warning 1: dimension #1 (pixels_per_line) is not a Longitude/X dimension.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Warning 1: dimension #0 (number_of_lines) is not a Latitude/Y dimension.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Is there anyway to shut up this warnings, or warnings in general?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Thanks</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Joaquim</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:PT"><br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>gdal-dev mailing list<o:p></o:p></pre>
<pre><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><o:p></o:p></pre>
<pre><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com">http://www.spatialys.com</a><o:p></o:p></pre>
</div>
</body>
</html>