<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=utf-8">
<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:Aptos;}
@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:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#467886;
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;}
@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="EN-US" link="#467886" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Fantastic Even. Thanks a lot.<o:p></o:p></p>
<p class="MsoNormal">(and ofc I meant to say grib2, not “gring2”)<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"><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 <even.rouault@spatialys.com>
<br>
<b>Sent:</b> Thursday, May 8, 2025 11:04 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] vsicurl and --range byte-range<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Joaquim,<span style="font-size:12.0pt;mso-ligatures:none"><o:p></o:p></span></p>
<p>You can combine /vsisubfile/ (<a href="https://gdal.org/en/stable/user/virtual_file_systems.html#vsisubfile-portions-of-files">https://gdal.org/en/stable/user/virtual_file_systems.html#vsisubfile-portions-of-files</a>) and /vsicurl/<o:p></o:p></p>
<p>/vsisubfile/${offset}_${length}/vsicurl/${url}<o:p></o:p></p>
<p>e.g.<o:p></o:p></p>
<p>$ gdalinfo /vsisubfile/802533_508958,/vsicurl/<a href="https://ecmwf-forecasts.s3.eu-central-1.amazonaws.com/20240301/00z/ifs/0p25/oper/20240301000000-24h-oper-fc.grib2">https://ecmwf-forecasts.s3.eu-central-1.amazonaws.com/20240301/00z/ifs/0p25/oper/20240301000000-24h-oper-fc.grib2</a>
--debug on<o:p></o:p></p>
<p>[...]<br>
Band 1 Block=1440x1 Type=Float64, ColorInterp=Undefined<br>
Description = 92500[Pa] ISBL="Isobaric surface"<br>
Metadata:<br>
GRIB_UNIT=[%]<br>
GRIB_COMMENT=Relative humidity [%]<br>
GRIB_ELEMENT=RH<br>
GRIB_SHORT_NAME=92500-ISBL<br>
GRIB_REF_TIME=1709251200<br>
GRIB_VALID_TIME=1709337600<br>
GRIB_FORECAST_SECONDS=86400<br>
GRIB_DISCIPLINE=0(Meteorological)<br>
GRIB_IDS=CENTER=98(ECMWF) SUBCENTER=0 MASTER_TABLE=27 LOCAL_TABLE=0 SIGNF_REF_TIME=1(Start_of_Forecast) REF_TIME=2024-03-01T00:00:00Z PROD_STATUS=0(Operational) TYPE=1(Forecast)<br>
GRIB_PDS_PDTN=0<br>
GRIB_PDS_TEMPLATE_NUMBERS=1 1 2 255 154 0 0 0 1 0 0 0 24 100 0 0 1 105 84 255 255 255 255 255 255<br>
GRIB_PDS_TEMPLATE_ASSEMBLED_VALUES=1 1 2 255 154 0 0 1 24 100 0 92500 255 -127 -2147483647<o:p></o:p></p>
<p>Even<o:p></o:p></p>
<div>
<p class="MsoNormal">Le 08/05/2025 à 23:48, 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">Hi,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="PT"> </span><o:p></o:p></p>
<p class="MsoNormal">I’m writing a tool to download ECMWF forecast data in gring2 format. But since those files have > 150 bands and most of times I’m only interested in a couple of them, I’m using the only documented mechanism that I found [1], which is the
“curl –range start-stop”. That works fine but what I would really like is to be able to use<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">gdal_translate /vsicurl/…<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">because then I should be able to save the result directly in netCDF and even get only a sub-region. But I’m not able to find a way to use both /vsicurl/ and a (equivalent) –range option. Is that possible and I didn’t find how to, or we
simple cannot do it?<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>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">[1] <a href="https://confluence.ecmwf.int/display/DAC/ECMWF+open+data%3A+real-time+forecasts+from+IFS+and+AIFS#ECMWFopendata:realtimeforecastsfromIFSandAIFS-DownloadASingleFieldWithWget">
https://confluence.ecmwf.int/display/DAC/ECMWF+open+data%3A+real-time+forecasts+from+IFS+and+AIFS#ECMWFopendata:realtimeforecastsfromIFSandAIFS-DownloadASingleFieldWithWget</a><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">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>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</body>
</html>