As quoted from the Javadoc, GridCoverageReader interface is intended to
read GridCoverages from the input stream in a sequential order .
Currently, there is no efficient nor thread safe way to deal with multiple coverages stored in the same file. In order to access different coverages, once you have opened a reader, you need to check if more coverages are available by checking hasMoreGridCoverages and then skip to the desired coverage. You can check the name of the current coverage through the getCurrentSubname method. The idea is to deprecate this methods in favor of methods which allow explicitly specifying the coverage to be accessed.
Moreover, GridCoverageReader defines metadata access and read method which provide access to the current coverage. We can add methods to select the specific coverage to be used by these operations but, in order to preserve backward compatibilities, we should preserve the ones without coverage name param. Moreover, we may consider changing metadata management from returning simple Strings to returning Object instances.
Additional notes on base implementation changes:
Base class implementing GridCoverageReader is AbstractGridCoverage2DReader.
Currently there is 1:1 relationship between an AbstractGridCoverage2DReader instance and a coverage. Suppose you are working against a NetCDF file which contains several measurements like AirTemperature, AirPressure (with elevation and time) which are 4D datasets. We can think about 2 different coverages.
We also propose to deprecate AbstractGridCoverage2DReader in favor of a new AbstractGridCoverageReader which preserves current methods for simpler readers (which allow to access single coverages) but which allows to get geospatial context (like GridEnvelope, GridRange, GridToWorld transformation, CoordinateReferenceSystem) and read access capabilities by coverage name. Current geospatial context getter method won't be changed to grant backward compatibility.
This work will also be made to prepare a smooth transition between old style coverage APIs (based on current GridCoverageReader which doesn't have logic to deal with time/elevation domains) and new coverage-api currently living on unsupported/coverage-experiment which allows for
- geospatial dimensions management (time domain, vertical domain, custom domains)
- 1 coverageAccess to deal with multiple underlying coverage sources
This proposal is under construction.
Voting has not started yet:
- Andrea Aime
- Ben Caradoc-Davies
- Christian Mueller
- Ian Turton
- Justin Deoliveira
- Jody Garnett
- Simone Giannecchini
This section is used to make sure your proposal is complete (did you remember documentation?) and has enough paid or volunteer time lined up to be a success
- API changed based on BEFORE / AFTER
- Update default implementation
- Update wiki (both module matrix and upgrade to to 2.5 pages) |
- Remove deprecated code from GeoTools project
- Update the user guide
- Update or provided sample code in demo
- review user documentation
GridCoverage2DReader (new interface extending GridCoverageReader)
Default implementation changes
list the pages effected by this proposal
- Module Matrix page