try {
pm.beginTask("Collecting stats...", IProgressMonitor.UNKNOWN);
StringBuilder regionString = new StringBuilder();
GridCoverage2D geodata = null;
if (object instanceof AbstractRasterGeoResource) {
AbstractRasterGeoResource rGeo = (AbstractRasterGeoResource) object;
AbstractGridCoverage2DReader gridCoverage2DReader = rGeo.resolve(
AbstractGridCoverage2DReader.class, pm);
geodata = ((GridCoverage2D) gridCoverage2DReader.read(null));
geodata = geodata.view(ViewType.GEOPHYSICS);
Envelope envelope = geodata.getEnvelope();