.setTileHeight(512).setTileWidth(512);
Hints hints = new Hints();
hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, l));
final BaseGridCoverage2DReader reader = new MatFile5Reader(
file, hints);
// /////////////////////////////////////////////////////////////////////
//
// read once
//
// /////////////////////////////////////////////////////////////////////
GridCoverage2D gc = (GridCoverage2D) reader.read(null);
GeoTiffWriter writer = new GeoTiffWriter(new File(fileOutputName));
writer.write(gc, null);
// ImageWriter writer = new TIFFImageWriterSpi().createWriterInstance();
// writer.setOutput(new FileImageOutputStream(new File(fileOutputName)));
// RenderedImage image = gc.getRenderedImage();
// writer.write(image);
writer.dispose();
gc.dispose(true);
reader.dispose();
}
}
}
}