final Hints hints = new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM,DefaultGeographicCRS.WGS84);
LOGGER.info("Reading the coverage through a file");
// get a gzipped ascii grid
final File f = TestData.file(this, "arcgrid/spearfish.asc.gz");
// Reading the coverage through a file
GridCoverageReader reader = new ArcGridReader(f);
final GridCoverage2D gc1 = (GridCoverage2D) reader.read(null);
LOGGER.info("Reading the gzipped coverage through an ImageInputStream");
// Reading the coverage through an ImageInputStream
final ImageInputStream iiStream = ImageIO
.createImageInputStream( new GZIPInputStream(
new FileInputStream(f)));
reader = new ArcGridReader(iiStream,hints);
final GridCoverage2D gc2 = (GridCoverage2D) reader.read(null);
LOGGER.info(" Reading the gzipped coverage through an InputStream");
// Reading the coverage through an InputStream
reader = new ArcGridReader( new GZIPInputStream(
new FileInputStream(f)),hints);
final GridCoverage2D gc3 = (GridCoverage2D) reader.read(null);
LOGGER.info("Reading the gzipped coverage through a URL");
// Reading the coverage through a URL
reader = new ArcGridReader( f.toURI().toURL(),hints);
final GridCoverage2D gc4 = (GridCoverage2D) reader.read(null);
// show the coverage or try to load the data
if (TestData.isInteractiveTest()) {
gc1.show();
gc2.show();