@Override
public GridEnvelope getOriginalGridRange(
final String coverageName ) {
DataStatistics<?> statistics = geowaveStatisticsStore.getDataStatistics(
new ByteArrayId(
coverageName),
BoundingBoxDataStatistics.STATS_ID);
int width = 0;
int height = 0;
// try to use both the bounding box and the overview statistics to
// determine the width and height at the highest resolution
if (statistics instanceof BoundingBoxDataStatistics) {
final BoundingBoxDataStatistics<?> bboxStats = (BoundingBoxDataStatistics<?>) statistics;
statistics = geowaveStatisticsStore.getDataStatistics(
new ByteArrayId(
coverageName),
OverviewStatistics.STATS_ID);
if (statistics instanceof OverviewStatistics) {
final OverviewStatistics overviewStats = (OverviewStatistics) statistics;
width = (int) Math.ceil(((bboxStats.getMaxX() - bboxStats.getMinX()) / overviewStats.getResolutions()[0].getResolution(0)));