-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Multiple Layer Datasets for netCDF CF-1.8, and Other Updates #1740
Conversation
…if CPLRealloc bug (probably not) or GCC bug (maybe not) or something else).
@rouault While I'm chipping away at the CI stuff what else would you like to have changed in the PR? EDIT: Macintosh build randomly did its thing again i.e. segfaulted in some place irrelevant to PR |
@rouault Thanks for the thorough review. I've went through and made necessary changes for your feedback (except the one that's left unresolved, but I don't think it's not too much to ask to not have the netCDFDataset handle inside the netCDFVID, since a VID can represent a group or a dataset, it's just, well, kind of awkward, and might be error prone). Now time to wait for CI... Any other things you would like addressed? |
|
@rouault Trusty and Macintosh builds failures due to failures unrelated to PR: Unrelated seg. fault on PROJ test:
and OS X had a network failure apparently.
[aside: loopback failure? interesting...] Could we possibly restart these specific ones? Also I don't know why but the Macintosh build keeps seg. faulting at the end for no reason with |
Looks like the Macintosh build went dark for no good reason this time :/.
Could you restart the build again, thanks. Sorry to have you keep doing this... |
Can you merge master in your branch ? I've commited a workaround to avoid a frequent stall in the Mac build |
Fix Issues with OS X Upstream CI
Alright, merge has been done! Here's hoping it all works out- |
Squashed and merged |
Oh so the Macintosh build finally stopped randomly dying huh (at least stopped dying enough)? Thanks for your efforts on getting the build to behave @rouault ! 👍 Glad this is finally merged... took a while. |
What does this PR do?
This PR contains the following updates:
What are related issues/pull requests?
Issue #1287
Writing System Rewrite
Previously, the CF-1.8 writer used a rather simple writing scheme- a state based system that would persist only between layer translation invocations and reset between each write. Unfortunately, the problem with this system is that it would use in-place dim resizing (which involved a lot of extra copying, with perhaps worse than linear complexity and especially slow for very large datasets with multiple layers).
The new CF-1.8 writer introduces something called "netCDFVirtualID." Essentially what this does is present new- but similar- interfaces to dim and var definition in a netCDF file, but does not write the variable to the dataset immediately. Instead, dim and var metadata is held in memory allowing dims to be resized at constant complexity. Until the dim is actually written through the new nc_vsync call.
To accomplish this, a small subset of netCDF API functions were brought to the netCDFVirtual layer; defining a variable or dimension in the netCDF virtual layer gives virtual netCDF IDs which are not guaranteed to be the same as the real netCDF ID. Attribute writing is also available (done through templating), so long as the variable exists ONLY in the virtual layer.
Using the virtual layer is specific to this use case of dimension resizing- in cases where no dimensions exist or are known ahead of time, using the real netCDF APIs directly is generally recommended (as the virtual layer would only slightly slow things down).
GeometryScribe has also been separated into two classes: a "ncScribe" class which manages general transaction handling to the netCDF file and a "Metadata" class which manages the layer's IDs in the netCDFVirtual layer, and the geometry container ID in the real netCDF file.
Tasklist
Is this Ready for Review?
👍 hopefully
Environment
Provide environment details, if relevant: