stcorp / harp

Data harmonization toolset for scientific earth observation data
http://stcorp.github.io/harp/doc/html/index.html
BSD 3-Clause "New" or "Revised" License
55 stars 18 forks source link

Improve HARP export format to support better handling by GIS applications #293

Closed svniemeijer closed 1 year ago

svniemeijer commented 1 year ago

At the moment any L3 gridded product that is saved in HARP format is read in QGIS with a wrong coordinate system reference. This means that combining the data with e.g. a map will not go correctly without first adjusting the CRS of the HARP gridded data.

One way that seems to work is to add long_name attributes to the latitude and longitude axis variables that are respectively set to latitude and longitude.

Whether this should indeed be using long_name attributes or perhaps standard_name or axis (see also the netCDF-CF conventions for the latitude coordinate) is to be determined.

We should also consider adding such attributes for other axis variables (datetime, datetime_start, altitude, pressure, etc.) if this improves interpretation of the data by other applications.

Since adding attributes will be an evolution of the HARP conventions, we need to be careful that whatever choice we make will indeed be the right one.

svniemeijer commented 1 year ago

Since QGIS uses GDAL under the hood, the GDAL netCDF driver documentation can also be relevant.

svniemeijer commented 1 year ago

It seems that with QGIS 3.30 / GDAL 3.6.2 this is no longer an issue. A gdalinfo NETCDF:<harpfile>:<variable> now gives proper lat/lon corner coordinates for 2D grid variables and the data also displays correctly in QGIS.

The CF conventions also mention that finding coordinate variables should mainly be done by looking at the unit of the variables. The use of standard_name and/or axis attributes is considered optional.