-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Piped input from wgrib2 read via /vsistdin/
outputs error; produced output is correct though
#5912
Comments
As an update, I also tested this with |
Due to how the driver works, it is not expected that reading from /vsistdin/ would work since we need to do a first scanning pass to do the inventory of concatened message, before being able to use the file. We should probably just reject attempts at reading GRIB from /vsistdin/ (or have a specific open option to mean that only one message is provided) |
I have been accepting the error message for now since the output is correct. Hence, I would vote for an option to indicate expected number of messages. |
that would rather be a SINGLE_MESSAGE=YES kind of option. We need to parse each GRIB2 message header to build a multi-band GDAL dataset. |
I stumbled upon this while doing a rather different call, where I first concat many wgrib files, then filter with wgrib, and then warp.
Using named pipes instead of |
The GRIB driver implementation in GDAL does not like streamed input from stdin. Hence the switch to a temporary file. OSGeo/gdal#5912
There's a usage issue of wgrib2. If you do "-grid -", you'll get a mix in stdout of the GRIB file and the indexing information it also outputs to stdout. Luckily, the GDAL GRIB reader is able to cope with that (with just the annoyance of a warning) |
Makes sense. Thank you for the explanation, Even! |
The GRIB driver implementation in GDAL does not like streamed input from stdin. Hence the switch to a temporary file. OSGeo/gdal#5912
The GRIB driver implementation in GDAL does not like streamed input from stdin. Hence the switch to a temporary file. OSGeo/gdal#5912
The GRIB driver implementation in GDAL does not like streamed input from stdin. Hence the switch to a temporary file. OSGeo/gdal#5912
Expected behavior and actual behavior.
When reading input via
/vsistdin/
from a piped output by thewgrib2
command, gdal detects on more Message than the piped output includes. This produces the following error output:The piped input has only one messages and the produced output file is correct.
Steps to reproduce the problem.
wgrib2 hrrr.t00z.wrfsfcf01.grib2 -match DSWRF -grib - | gdalwarp -t_srs EPSG:32613 -tr 50 50 /vsistdin/ warped.tif
The above will produce the stated error message above.
Operating system
Tested on:
165344057622.04~6277a18 SMP PREEMPT Wed May 25 01GDAL version and provenance
Tested with two versions Installed via conda-forge:
gdal=3.5.0=py310h8172e47_2
libgdal=3.4.3=h56144a5_0
Wgrib2 command version:
hrrr.t00z.wrfsfcf01.zip
The text was updated successfully, but these errors were encountered: