-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NetCDF positive attribute in vertical Z axis variable seems to be ignored #78
Comments
That looks like a bug. I'll try and find some time to fix it, but I'm currently very busy on other projects at the moment. |
In the libraries which underpin ncWMS2, we keep metadata about the vertical CRS (including the fact that positive values increase downwards). The problem is that this metadata is not making it through to the WMS capabilities document - there is no way of distinguishing whether a WMS layer's vertical coordinates represent depth or height, which client applications may want for layer comparison. However, I don't think there's anything intrinsically wrong with the capabilities document stating that the values of depth on the vertical axis are positive (since they are...). So I think that the underlying issue is that we're not specifying the units correctly - reading the WMS spec, If the vertical axis values represent height in metres, we can use The problem comes when we have units of pressure, where there are no named vertical CRSs defined. The best option in that case may be to use an ad hoc approach, perhaps defining the @jonblower - What do you think about this? |
I think in ncWMS1 the vertical axis was always "elevation" but if the underlying data was "depth" we just used negative values in the Capabilities doc. Could this work in EDAL/ncWMS2? Using the CRS codes is possible but I don't know how many clients will recognise them. For pressure I can't remember what we did, I suspect we just set the units to "Pa" or something like that. |
The problem with just negating the values in the Capabilities document is that GetMap will need to negate requested elevation values as well, which would mean that we would have to do that throughout EDAL. So for an axis with a vertical CRS stating that positive is down and containing values of 0,5,10, our general-purpose methods for finding whether a value is contained in the axis would have to report The only way to feasibly do it is at the data reading level - we'd need to detect the Either way, we should probably use CRS codes for the @SMichalet - What issues is this bug causing you? Knowing that would help a lot in deciding what the best solution is. |
Yes, I think if we simply negate the values we'd only do this "at the last minute" in the creation of the Capabilities doc, or somewhere in the WMS-specific code. In EDAL the metadata should be as close to the data files as possible (i.e. usually with positive coordinate values and appropriate return values for IIRC, in ncWMS1, we did something like "if isPositiveUpwards() == false and axisType != pressure then use an "elevation" axis but negate the coordinate values". (I might be wrong though.) One thing to watch is that giving a CRS code might imply a level of specificity that we can't warrant from the data (EPSG 5715 and 5831, and "depth below ellipsoid" are all different CRSs and we can't always tell the difference from the source files). I don't know what the best "default" behaviour might be. |
So no-one from the ncwms-users list seems to have an opinion, and after talking to Martin Desruisseaux it seems that the issue of vertical CRSes is not settled amongst either the OGC or in the CF-conventions. As we discussed offline, I think the best solution is that we use the |
The netCDF attribute "positive" for vertical Z axis seems to be ignored.
I take a netCDF file whith "positive" attribute equal to "down" for a vertical Z Axis (depth in my netcdf file) :
with values :
And I get positive values in ncWMS getCapabilities :
In the first version of ncWMS, with the same file, I get correct negative values :
I'm using ncWMS 2.2.3.
Am I missing something ?
The text was updated successfully, but these errors were encountered: