Hi,
this pull request follows up with GeoTools multiple coverages per reader one to leverage the new API:
https://github.com/geoserver/geoserver/pull/256
The bulk of the changes is the mechanical substitution of the AbstractGridCoverage2DReader class with the GridCoverage2DReader interface.
This follows with some minor changes, like using getCoordinateReferenceSystem() instead of getCRS() (to be uniform with the rest of the coverage API) and recognizing that calling onto the metadata accessor methods might raise a IOException, which is valid since complex formats might actually have to do IO in order to gather the list of times and elevations for a particular source.
Moreover, ResourcePool now pulls a trick, allowed by the interface, to avoid having existing code deal with multiple coverages per reader: basically, before returning it to “userland” the reader is wrapped so that it can only return one and just one coverage (the one we asked the reader for).
CoverageInfo is also modified so that it has a new field, nativeCoverageName, used to select the right coverage out of the reader, in case the reader has more than one coverage.
In case it’s missing, for backwards compatibility, we just pick the first coverage out of the reader.
The GUI has consequently been modified to list all the coverages available in the reader, following the same paradigm as the vector layers.
Let me know if you have feedback, or want me to wait in order to review the pull request (I’ll have to wait for the geotools portion to land anyways, but I’d be nice to know if someone plans to review the pull request)
Cheers
Andrea
–
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it