I downloaded h5 VIIRS file by CLASS NOOA website.

In particular I am interested in Snow Cover Binary Maps EDR and I need to reproject them in lat/lon or UTM.

I tried to use gdal warp to this aim but, although I get correct latitude, I get completely wrong longitude (for example in my AOI I got 170 degrees instead of 10 degrees E), when I open tif file using qgis or envi

Using gdalinfo I get the names of the subdatasets. In particular one of them is the subdataset:

SUBDATASET_16_DESC=[6144x6400]//All_Data/VIIRS-SCD-BINARY-SNOW-MAP-EDR_All/SnowCoverBinaryMap (8-bit unsigned character)

consequently the commmand line I tried is the following:

gdalwarp -t_srs 'epsg:4326' HDF5:"GITCO-VSCMO_npp_d20141212_t1043482_e1049286_b16189_c20160530182604182662_noaa_ops.h5"://All_Data/VIIRS-SCD-BINARY-SNOW-MAP-EDR_All/SnowCoverBinaryMap rip.tif 

I also tried to insert -s_srs 'epsg:4326' but the result is the same.

Do you have any suggestion, please?

  • Can you give a detailed link where to download the VIIRS file you work on?
    – AndreJ
    Aug 1, 2016 at 14:08
  • Yes sure. I use CLASS Website: [link] (class.ncdc.noaa.gov/saa/products/…) select: JPSS Visible Infrared Imaging Radiometer Suite Environmental Data Record (VIIR_EDR) and then check in: VIIRS Snow Cover/Depth Binary Map EDR (VSCMO) Aug 2, 2016 at 14:36

1 Answer 1


Similar to Unable to warp HDF5 files, the hdf geolocation seems to be interpreted wrong by GDAL. If you extract the subdataset as a vrt file, it has GCP points inside, but they are above 180° longitude, and a shift of 180° does not fit. Subdatasets 2 and 3 contain latitudes and longitudes with reasonable values.

So I took the same workaround as given in the linked question, building a vrt file manually around the dataset:

<VRTDataset rasterXSize="6400" rasterYSize="6144">
  <Metadata domain="GEOLOCATION">
    <MDI key="LINE_OFFSET">0</MDI>
    <MDI key="LINE_STEP">1</MDI>
    <MDI key="PIXEL_OFFSET">0</MDI>
    <MDI key="PIXEL_STEP">1</MDI>
    <MDI key="X_BAND">1</MDI>
    <MDI key="X_DATASET">HDF5:"gitco.h5"://All_Data/VIIRS-IMG-GEO-TC_All/Longitude</MDI>
    <MDI key="Y_BAND">1</MDI>
    <MDI key="Y_DATASET">HDF5:"gitco.h5"://All_Data/VIIRS-IMG-GEO-TC_All/Latitude</MDI>
  <VRTRasterBand dataType="Byte" band="1">
      <SourceFilename relativeToVRT="1">HDF5:"gitco.h5"://All_Data/VIIRS-SCD-BINARY-SNOW-MAP-EDR_All/SnowCoverBinaryMap</SourceFilename>
      <SourceProperties RasterXSize="6400" RasterYSize="6144" DataType="Byte" BlockXSize="6400" BlockYSize="1" />
      <SrcRect xOff="0" yOff="0" xSize="6400" ySize="6144" />
      <DstRect xOff="0" yOff="0" xSize="6400" ySize="6144" />

and running gdalwarp without the use of the wrong GCP:

gdalwarp -geoloc -t_srs EPSG:4326 gitco.vrt gitco_16_warped.tif -overwrite -dstnodata 50

The result covers most of Europe:

enter image description here

I have applied a -dstnodata value of 50, because the data is mostly around 0 and 255.

  • Thank you! It seems to solve the problem. I still have only one question. Do you think that the deletion of GCP could affect the geographic accuracy locally? Aug 4, 2016 at 9:45
  • The GCP are built from the subdatasets 2 and 3, but shifted by 180° of Longitude. 3000 points are taken, but only the upper left corner is included (which appears lower right in EPSG:4326). The other corners are extrapolated from the last nearby GCP, which is rather inaccurate. Using the vrt seems to solve that probem (and the 180° shift).
    – AndreJ
    Aug 5, 2016 at 7:18
  • @GiovanniCuozzo please accept the answer if it was helpful tp you.
    – AndreJ
    Jan 24, 2017 at 16:09
  • Is this bow-tie effect in the image. How do you fix it?
    – Leonidas
    Nov 3, 2018 at 18:41
  • @LeonidasLiakos the bended edges come from the satellites view. You can not change it.
    – AndreJ
    Nov 3, 2018 at 20:15

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.