i download data from here https://nsidc.org/data/SPL2SMP/versions/3#, but i can not open it in QGIS.

Do you know how to open this data in QGIS?

  • 3
    Possible duplicate of this question – landocalrissian Oct 14 '16 at 13:06
  • Add as raster layer to QGIS, hdf5 format – mdsumner Oct 14 '16 at 13:51
  • @mdsumner have you tried one? I get a raster of X: 3 Y: 18570 cells. And HDF5view does not like the file. – AndreJ Oct 14 '16 at 15:04
  • Maybe related: gis.stackexchange.com/questions/200754/… although the solution is for R. – AndreJ Oct 14 '16 at 15:23
  • Are two of the columns/ layers lon and lat? gdal warp in.h5 out.ti -t_srs "some projection" will probably work. What version of qgis is this? Also, just put details with the q, and details on what yiu tried exactly, it's all important. – mdsumner Oct 15 '16 at 5:58

The raster can be loaded into QGIS with the HDF5 driver, but it gets displayed as X: 3 Y: 18570 cells. Gdalinfo reports just 2 subdatasets, but no longitudes or latitudes.

The information on the website notes that latitudes and longitudes should be stored in separate subdatasets, along with several other datasets.

Using H5dump from HDF Tools and HDF Compass, the missing tables appear, so this seems to be an unusual HDF5 storage that GDAL imports only partially. The current Windows binary of HDFview does not like HDF5 files at all.

Looking closer, you see that most datasets are one-dimensional arrays, with the EASE Grid row and cell number, latitude and longitude stored in separate datasets. Empty cells are simply discarded, saving much table space.

GDAL does not seem to like those 1-D tables. The landcover_class table that GDAL can read consists of 3 columns with the three dominant landcover classes per EASE grid cell. But without lon/lat information you can not use it.

I finally managed to get the SMAP L2 data tables with Panoply exported as longitude, latitude and landcover_class CSV files, merged them into one CSV table with Libre Office, and imported that as delimited text points into QGIS:

enter image description here

As you can see, this is a dataset from just one half-orbit.

The SMAP L3 dataset works far better. You can extract a subdataset with

gdal_translate -a_ullr -17334194 7356860 17334194 -7356860 -a_srs epsg:3410 -a_nodata -9999 HDF5:"smap_l3.h5"://Soil_Moisture_Retrieval_Data/soil_moisture sm.tif

to get a picture of all orbits of the day:

enter image description here

Unfortunately, this does not work for the landcover_class dataset, which comes as 3-dimensional (the three dominant land cover classes per EASE grid cell). GDAL tries to extract 406 bands of a 3x964 array, instead of 3 bands of a 964x406 array as intended by the data provider.

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.