qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

Netcdf mesh aligned, or not? #28550

Closed qgib closed 4 years ago

qgib commented 5 years ago

Author Name: Richard Duivenvoorde (@rduivenvoorde) Original Redmine Issue: 20730 Affected QGIS version: 3.5(master) Redmine category:data_provider/mdal Assignee: Peter Petrik


I created a small 7x3 cell netcdf with a python script: test.nc (attached)

Loaded in QGIS3 as gdal raster you see 7x3 cells Loaded as netcdf in Geoserver and served as wms you see 7x3 cells If you load this small set as Mesh in QGIS3 you see 6x2 cells. In the attached 'mesh.png' those three layers are all visible.

Note that I'm no netcdf expert! So I'm 100% sure that this IS actually a problem. I think all depends on the definition of a mesh: is it the middle point of grid cells or not?

When loaded in Panoply netcdf viewer: https://www.giss.nasa.gov/tools/panoply/ you also can see both situations see attached screenies: panoply_interpolate.png zoomed in to test.png and checkbox 'interpolate' checked panoplyNOinterpolate.png: checkbox 'interpolate' UNchecked.

So my feeling is that it depends on the interpretation of a mesh/grid and it's visualisation.

Maybe some netcdf guru's can have a say about this?

Peter Petrik asked me to create this issue to further investigate.


rduivenvoorde commented 4 years ago

@PeterPetrik there is a user question related to this on the GDAL-dev mailing list:

https://lists.osgeo.org/pipermail/gdal-dev/2019-October/051014.html

saberraz commented 4 years ago

@rduivenvoorde currently we use gdal driver to read those types of netcdf (and also grib file which are often on on a guassian grid: https://www.ncl.ucar.edu/Document/Functions/sphpk_grids.shtml) through mdal. This is not an ideal situation:

Similar to UGRID netcdf, we should try and parse the files directly. It will avoid the issue you have reported and also gives more flexibility: https://github.com/lutraconsulting/MDAL/issues/165

PeterPetrik commented 4 years ago

This should be fixed upstream with lutraconsulting/MDAL#165