4

I have the following data: http://fizz.phys.dal.ca/~atmos/SURFACE_NO2_ANNUAL_HDF.zip which is provided by the Atmospheric Composition Analysis Group (alternativley you can go to the Website of the ACAG and find the link under "Annual ground-level NO2 mixing ratio ~9:30-11:30 overpass time, in [hdf] format."

The data is provided as .hdf files, which do not contain any information about the CRS. When I load them into QGIS 3.8 or higher (with ArcGIS the problem is the same), the maps are shown upside down. I have found related questions, where people do some work arounds using world files. However, I did not manage to properly do this for my specific problem here.

So the basic question is: can I somehow save the file in a standard CRS like WGS84 EPSG:4326 and put the rasters into the "right" projection?

1 Answer 1

2

The GDAL driver documentation https://gdal.org/drivers/raster/hdf4.html is not promising.

Georeference

There is no universal way of storing georeferencing in HDF files. However, some product types have mechanisms for saving georeferencing, and some of these are supported by GDAL. Currently supported are (subdataset_type shown in parenthesis):

HDF4 files created by GDAL (GDAL_HDF4)

ASTER Level 1A (ASTER_L1A)

ASTER Level 1B (ASTER_L1B)

ASTER Level 2 (ASTER_L2)

ASTER DEM (AST14DEM)

MODIS Level 1B Earth View products (MODIS_L1B)

MODIS Level 3 products (MODIS_L3)

SeaWiFS Level 3 Standard Mapped Image Products (SEAWIFS_L3)

However, we do know something about the dataset:

  • It probably covers the whole Earth between -180 and 180 E, -90 and 90 N
  • It appears upside down but left-to-right is OK
  • By the metadata that is shown by gdalinfo the CRS is EPSG:4326

That is enough for writing a gdal_translate command that turns the image north-up. Notice that this is not a general solution and is totally based on the assumption that we know the upper left and lower right coordinates.

gdal_translate -a_ullr -180 -90 180 90 -a_srs epsg:4326 SURFACE_NO2_010x010_ANNUAL_2012.hdf north-up.tif

north-up image made with gdal

1
  • Genius, thank's a lot!
    – philsch
    Commented Aug 25, 2020 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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