@Override public FieldStatisticsQueryBuilder<Interval> timeRange() { return TimeRangeDataStatistics.STATS_TYPE.newBuilder(); } }
@Override public InternalDataStatistics<GridCoverage, ?, ?> createDataStatistics( final StatisticsId statisticsId) { InternalDataStatistics<GridCoverage, ?, ?> retVal = null; if (OverviewStatistics.STATS_TYPE.equals(statisticsId.getType())) { retVal = new OverviewStatistics(); } else if (BoundingBoxDataStatistics.STATS_TYPE.equals(statisticsId.getType())) { retVal = new RasterBoundingBoxStatistics(); } else if (RasterFootprintStatistics.STATS_TYPE.equals(statisticsId.getType())) { retVal = new RasterFootprintStatistics(); } else if (HistogramStatistics.STATS_TYPE.equals(statisticsId.getType()) && (histogramConfig != null)) { retVal = new HistogramStatistics(histogramConfig); } else { // HP Fortify "Log Forging" false positive // What Fortify considers "user input" comes only // from users with OS-level access anyway LOGGER.warn( "Unrecognized statistics type " + statisticsId.getType().getString() + " using count statistic"); retVal = new CountDataStatistics<>(); } return retVal; }
@Override public FieldStatisticsQueryBuilder<Envelope> bbox() { return BoundingBoxDataStatistics.STATS_TYPE.newBuilder(); }
private void init() { int supportedStatsLength = 2; if (histogramConfig != null) { supportedStatsLength++; } supportedStats = new StatisticsId[supportedStatsLength]; supportedStats[0] = OverviewStatistics.STATS_TYPE.newBuilder().build().getId(); supportedStats[1] = BoundingBoxDataStatistics.STATS_TYPE.newBuilder().build().getId(); if (histogramConfig != null) { supportedStats[2] = HistogramStatistics.STATS_TYPE.newBuilder().build().getId(); } visibilityHandler = new DefaultFieldStatisticVisibility<>(); }
@Override public GeneralEnvelope getOriginalEnvelope(final String coverageName) { final Envelope envelope = geowaveDataStore.aggregateStatistics( BoundingBoxDataStatistics.STATS_TYPE.newBuilder().setAuthorizations( authorizationSPI.getAuthorizations()).dataType(coverageName).build()); if (envelope == null) { CoordinateReferenceSystem crs = getCoordinateReferenceSystem(coverageName); double minX = crs.getCoordinateSystem().getAxis(0).getMinimumValue(); double maxX = crs.getCoordinateSystem().getAxis(0).getMaximumValue(); double minY = crs.getCoordinateSystem().getAxis(1).getMinimumValue(); double maxY = crs.getCoordinateSystem().getAxis(1).getMaximumValue(); final GeneralEnvelope env = new GeneralEnvelope(new Rectangle2D.Double(minX, minY, maxX - minX, maxY - minY)); env.setCoordinateReferenceSystem(crs); return env; } // try to use both the bounding box and the overview statistics to // determine the width and height at the highest resolution final GeneralEnvelope env = new GeneralEnvelope( new Rectangle2D.Double( envelope.getMinX(), envelope.getMinY(), envelope.getWidth(), envelope.getHeight())); env.setCoordinateReferenceSystem(getCoordinateReferenceSystem(coverageName)); return env; }