Reading-eScience-Centre / edal-java

Environmental Data Abstraction Layer libraries
Other
38 stars 30 forks source link

ncWMS2 clips figures when UGRID faces are fully specified #82

Closed frizwi closed 7 years ago

frizwi commented 7 years ago

For a UGRID file that has faces, edges and nodes fully specified the images that ncWMS2 is producing (as seen by Godiva3) are being clipped as per the min/max of the face coordinates, hence the rest of the cell outside is not rendered.

Below is the original email thread that sparked this issue and I have attached the said image and the netCDF file that reproduces this:

Farhan,

This looks like a bug. Initially when I implemented the UGRID standard, the only test data I had was only defined by its nodes (i.e. its faces were not specifically defined). In that case, it's not possible to determine a bounding region for the data, so I simply took the min/max values in each axis of the co-ordinate system (which is what you see). For the case where the faces are fully defined, this shouldn't happen.

Currently we do not have anyone working on ncWMS - in the past it was only me, and I have moved to another job where ncWMS development is low priority. However, I may find some time to look into this, although I can't promise anything. The best thing to do would be to file a bug here:

https://github.com/Reading-eScience-Centre/edal-java/issues

and, if possible, attach the full NetCDF dataset (or at least one vertical level + time value of your dataset). If it's urgent and you have a specific deadline that you would like to see this implemented by, please mention it in the bug report and I'll prioritise it accordingly.

Thanks, Guy

On 16/02/17 02:31, Farhan Rizwi wrote:

Hi,

I work with the Coastal Environmental modelling team at CSIRO, Hobart, Australia. If you're interested here is our webpage : http://emg.cmar.csiro.au/

We have been using our own SHOC hydrodynamic modelling suite of software for over 20 years. Up until now, it has been a finite-difference model based on orthogonal curvilinear grids. However, we are now in the process of implementing a finite-element model using unstructured grids and as such are adopting the new UGRID-1.0 format as per this spec: http://ugrid-conventions.github.io/ugrid-conventions/#data-defined-on-unstructured-meshes, specifically the 3D layered mesh topology.

I've got our netCDF file set up as per spec. and it seems to be displaying the data properly in Godiva3 except that the rendering on the map seems to be clipping/cropping the images at the face locations. See attached. I was expecting full hexagons shown but it seems to be truncating them. The nodes are fully specified so I'm wondering if you have any ideas why its not fully showing? Is it something to do with the bounds that I have not specified or is it just expected behaviour?

I have attached the netCDF header as well.

Thanks in advance for your help

Cheers, Farhan

hex

out_small.nc.gz

guygriffiths commented 7 years ago

Turned out that the bounding box (which is the first port-of-call for whether or not a point is part of the mesh) was only being calculated on the nodes, not the boundaries. Fixed by https://github.com/Reading-eScience-Centre/edal-java/commit/b593cc3622e8e3b24a2dca0a60a12f2d2f8c1fda