Jerry,
I am looking at a similar problem. I would like a solution that also works with ImageMosaic to take a collection of scalar forecast_reference_time and output forecast_reference_time(t) as an extra variable alongside a data variable delivered by WCS.
This problem is also related to the need to gather GRIB/NetCDF variable attributes and add them to NetCDF output. See the analysis here:
https://github.com/geotools/geotools/pull/1417
https://osgeo-org.atlassian.net/browse/GEOS-7901
Again, the situation is more complicated when the output is created with ImageMosaic. I think I have found a spot in GranuleDescriptor where the required information can be passed with a small API change. I am investigating. My goal is to avoid duplication.
I suspect that we will need an API change, and thus a change proposal.
I see three things that we need:
(1) Collection of NetCDF/GRIB2 variable attributes from input and their application to WCS NetCDF output. What to do with ImageMosaic when attributes from different granules are mismatched is an open question.
(2) Identification of extra variables from input NetCDF/GRIB2 files for inclusion in WCS NetCDF output. This will include their attributes. We will probably have to discard attributes like "coordinates" as there is much renaming on output. This part will likely need a UI change.
(3) ImageMosaic of extra variables, for example forecast_reference_time mosaicked to forecast_reference_time(t). Whether this is generic or forecast_reference_time is handled as a special case is an open question.
Kind regards,
Ben.
On 02/03/17 01:02, Wilwerding, Jerry wrote:
I have netcdf weather data that includes the following variables (I've left off the attributes and data):
byte wxVariable(t, z, y, x);
double t(t);
double z(z);
double y(y);
double z(z)
double start_time;
double stop_time;
double expiration_time;
double forecast_period(t);
double forecast_reference_time;
int grid_mapping;
The end user wants all of the 'extra' time variables included in the WCS netcdf output.
I can either alter Geoserver code to change the way the netcdf is written or I can modify the netcdf file outside of Geoserver before returning to the client.
First step is to determine if modifying Geoserver code to do this is possible within the current overall design.
I've been looking at the NetCDFOutputManager. Everything is based upon a GranuleStack associated with the wxVariable (assuming wxVariable is the CoverageId in a GetCoverage request). I don't see a clean way to associate other variables within the netcdf data with the wxVariable.
Looking for options:
Is there a way to associate the other variables (start_time, stop_time, etc) with the wxVariable that simply overlooked?
Is there a clean way to have a GranuleStack include these extra variables? This idea seems incompatible with the current design, but figured I'd ask anyway.
Is there a clean way to include the original netcdf file path in the GranuleStack? If so, I could modify netcdf-out behavior to include 'extra' netcdf variables based upon configuration settings by reading the original file and extracting these 'extra' time variables and include them when writing the netcdf variable. I'm currently storing the netcdf file on disk. Not sure if this idea completely falls apart if data is stored differently.
Any suggestions is appreciated.
Thanks,
Jerry Wilwerding
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
--
Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <http://transient.nz/>
New Zealand