<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi,</p>
<p>I don't know anything about Julia but I'd suspect that there must
be something particularly slow in the way it interacts with C. For
comparison, "time python3
swig/python/gdal-utils/osgeo_utils/samples/ogrinfo.py
/vsigzip//vsicurl/<a class="moz-txt-link-freetext" href="https://bulk.meteostat.net/v2/hourly/2022/08554.csv.gz">https://bulk.meteostat.net/v2/hourly/2022/08554.csv.gz</a>
-al > /dev/null" that does essentially your loop, and also
prints on stdout, runs in 1.5 seconds (compared to native ogrinfo
that runs in 0.7 s). Perhaps you could write a Julia wrapper to
get all fields of feature at once and return whatever dictionary
or equivalent data structure is idiomatic (and efficient )in Julia
? Also are you sure your Julia wrapper is built with optimization
enabled?<br>
</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 24/06/2025 à 16:33, Joaquim Manuel
Freire Luís via gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:AM6PR04MB6440E6D2A5A0C9EE48B5B050A678A@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:Aptos;}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:#467886;
text-decoration:underline;}span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;}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"><span lang="PT">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="PT"><o:p> </o:p></span></p>
<p class="MsoNormal">Im trying to read files like <o:p></o:p></p>
<p class="MsoNormal"><a
href="https://bulk.meteostat.net/v2/hourly/2022/08554.csv.gz"
moz-do-not-send="true" class="moz-txt-link-freetext">https://bulk.meteostat.net/v2/hourly/2022/08554.csv.gz</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">in my Julia wrapper. The point is that,
although I’m kind off succeeding, the hole operation is very
slow.<o:p></o:p></p>
<p class="MsoNormal">What I’m doing (code not committed yet so
can’t post a link) is to read like this<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">layer = getlayer(dataset, 0)<o:p></o:p></p>
<p class="MsoNormal">for f in layer<o:p></o:p></p>
<p class="MsoNormal"> for k = 1: Gdal.nfield(f)<o:p></o:p></p>
<p class="MsoNormal">
Gdal.getfield(f, k-1)<o:p></o:p></p>
<p class="MsoNormal">…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This works but it’s extremely slow because
each “getfield” takes about 1e-4 seconds and the file has ~8 k
rows, each with 13 fields. That amounts to > 10 sec.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ve searched but couldn’t find a way to
read the entire file at once (which takes 1e-2 seconds if I
read it, locally, with a gzip wrapper) and return it as a
single string array that I could parse later.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is that possible? <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Joaquim<o:p></o:p></p>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</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>