1

I am trying to convert a GRIB2 file to a GeoTIFF file using gdal.

My Commands:

gdal_translate -b 1 -a_srs EPSG:3857 some.grib2 some.grib2.tif

gdalwarp -t_srs '+proj=longlat +datum=WGS84 +ellps=WGS84 +units=m +no_defs' -te -130.103387 20.196426 -60.885910 52.807544 -tr 0.0174532925199433 0.0174532925199433 -r bilinear some.grib2.tif some.grib2.tif.reproj

I am receiving the following error:

ERROR 1: some.grib2.tif.reproj, band 1: Failed to compute statistics, no valid pixels found in sampling.

Source GRIB2 File (some.grib2): https://www.dropbox.com/s/zt1jzje64xvabbz/some.grib2?dl=0

3
  • try calling the output file reproj_some.grib2.tif (or some such ending in .tif)
    – Ian Turton
    Aug 6 '20 at 14:32
  • No dice, unfortunately!
    – arnpry
    Aug 6 '20 at 15:36
  • The link is unavailable.
    – Aaron
    Sep 23 '20 at 19:07
1

You are overriding the projection of the grib2 file, in gdal_translate, with EPSG:3857, when the coordinate reference system of the data is not EPSG:3857.

Just remove the -a_srs EPSG:3857 in the gdal_translate command and you will not find the invalid pixels coordinates error.

In gdal_warp, you are not defining the driver to use for the output, and GDAL will not be able to deduce it from .reproj file extension, so please define the output format with -of parameter or change the file extension for the output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.