<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>When GDAL_OF_VERBOSE_ERROR is not set, GDALOpenEx(), the generic
opening logic, doesn't emit a CPLError(). Here the error is
emitted by the XYZ driver itself. Normally the Open() method of
drivers isn't supposed to emit errors until it is that the input
dataset belong to them. The XYZ driver is a bit particular,
because it doesn't have much hints to know if a dataset is a XYZ
(with a structure it can't handle, hence an error message) or not.<br>
</p>
<div class="moz-cite-prefix">Le 29/06/2025 à 21:52, Joaquim Manuel
Freire Luís a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:AM6PR04MB644099DE728D6CBBC3A4F141A647A@AM6PR04MB6440.eurprd04.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator"
content="Microsoft Word 15 (filtered medium)">
<style>@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:Aptos;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}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-ligatures:none;}span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-ligatures:standardcontextual;}span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}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]-->
<div class="WordSection1">
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Silenced now. But if the GDALOpenEx docs
say<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Verbose error: GDAL_OF_VERBOSE_ERROR. If
set, a failed attempt to open the file will lead to an error
message to be reported.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">When it is not set (the case here) it
should not need this “extra care”, no?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-family:"Calibri",sans-serif;mso-ligatures:none">From:</span></b><span
style="font-family:"Calibri",sans-serif;mso-ligatures:none">
Even Rouault <a class="moz-txt-link-rfc2396E" href="mailto:even.rouault@spatialys.com"><even.rouault@spatialys.com></a>
<br>
<b>Sent:</b> Sunday, June 29, 2025 8:24 PM<br>
<b>To:</b> Joaquim Manuel Freire Luís
<a class="moz-txt-link-rfc2396E" href="mailto:jluis@ualg.pt"><jluis@ualg.pt></a>; <a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [gdal-dev] GDALOpenEx() not failing
silently<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi,<span style="font-size:12.0pt;mso-ligatures:none"><o:p></o:p></span></p>
<p>you can surround the call to GDALOpenEx() with<o:p></o:p></p>
<p>CPLPushErrorHandler(CPLQuietErrorHandler);<o:p></o:p></p>
<p>... GDALOpenEx() here ...<o:p></o:p></p>
<p>CPLPopErrorHandler();<o:p></o:p></p>
<div>
<p class="MsoNormal">Le 29/06/2025 à 21:20, Joaquim Manuel
Freire Luís via gdal-dev a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="PT"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="PT">Hi,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="PT"> </span><o:p></o:p></p>
<p class="MsoNormal">Again the Julia wrapper. In it to find if
a file holds a raster or a vector I first open it with
GDAL_OF_RASTER and see it the return pointer is NULL. This
has been working well and SILENTLY when it fail (because a
OGR vector file name was passed in). But with these
Meteostat .csv.gz files it fails (expected) but prints an
ERROR 1 message.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">The closes (to C and perhaps Python) I
can reproduce is this<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">julia>
GMT.Gdal.GDALOpenEx("/vsigzip//vsicurl/<a
href="https://bulk.meteostat.net/v2/daily/08554.csv.gz"
moz-do-not-send="true" class="moz-txt-link-freetext">https://bulk.meteostat.net/v2/daily/08554.csv.gz</a>",
GMT.Gdal.GDAL_OF_RASTER, C_NULL, C_NULL, C_NULL)<o:p></o:p></p>
<p class="MsoNormal">ERROR 1: At line 1, did not find X, Y
and/or Z values<o:p></o:p></p>
<p class="MsoNormal"><span lang="PT">Ptr{Nothing}
@0x0000000000000000</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="PT"> </span><o:p></o:p></p>
<p class="MsoNormal">All works right, but this error message
is annoying (and normal users will not understand it).<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Anything I can do to shut it up?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Joaquim <o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;mso-ligatures:none"><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"
moz-do-not-send="true" class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a><o:p></o:p></pre>
<pre><a
href="https://lists.osgeo.org/mailman/listinfo/gdal-dev"
moz-do-not-send="true" class="moz-txt-link-freetext">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" moz-do-not-send="true"
class="moz-txt-link-freetext">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>