<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Joaquim,</p>
<p>You can combine /vsisubfile/
(<a class="moz-txt-link-freetext" 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/</p>
<p>/vsisubfile/${offset}_${length}/vsicurl/${url}<br>
</p>
<p>e.g.<br>
</p>
<p>$ gdalinfo
/vsisubfile/802533_508958,/vsicurl/<a class="moz-txt-link-freetext" 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<br>
</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<br>
</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 08/05/2025 à 23:48, Joaquim Manuel
Freire Luís via gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:AM6PR04MB6440A420C08B621FC8DCAAC0A68BA@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">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"
moz-do-not-send="true" class="moz-txt-link-freetext">
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>
</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>