Skip to content

Commit 1a655a3

Browse files
authored
GEOWAVE-1045: ingest at all lower resolution pyramid levels (#1047)
1 parent 69120ea commit 1a655a3

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

extensions/adapters/raster/src/main/java/mil/nga/giat/geowave/adapter/raster/adapter/RasterDataAdapter.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import org.geotools.geometry.jts.GeometryClipper;
5555
import org.geotools.geometry.jts.JTS;
5656
import org.geotools.geometry.jts.ReferencedEnvelope;
57+
import org.geotools.referencing.operation.projection.MapProjection;
5758
import org.geotools.referencing.operation.transform.AffineTransform2D;
5859
import org.geotools.renderer.lite.RendererUtilities;
5960
import org.geotools.resources.coverage.CoverageUtilities;
@@ -137,6 +138,7 @@ public class RasterDataAdapter implements
137138
{
138139
static {
139140
SourceThresholdFixMosaicDescriptor.register(false);
141+
MapProjection.SKIP_SANITY_CHECKS = true;
140142
}
141143

142144
public final static String TILE_METADATA_PROPERTY_KEY = "TILE_METADATA";
@@ -499,14 +501,9 @@ public Iterator<GridCoverage> convertToIndex(
499501
final double[] tileRangePerDimension = new double[bounds.getDimensionCount()];
500502
final double[] maxValuesPerDimension = bounds.getMaxValuesPerDimension();
501503
final double[] minValuesPerDimension = bounds.getMinValuesPerDimension();
502-
double maxSpan = -Double.MAX_VALUE;
503504
for (int d = 0; d < tileRangePerDimension.length; d++) {
504505
tileRangePerDimension[d] = ((maxValuesPerDimension[d] - minValuesPerDimension[d]) * tileSize)
505506
/ gridEnvelope.getSpan(d);
506-
507-
maxSpan = Math.max(
508-
gridEnvelope.getSpan(d),
509-
maxSpan);
510507
}
511508
final TreeMap<Double, SubStrategy> substrategyMap = new TreeMap<Double, SubStrategy>();
512509
for (final SubStrategy pyramidLevel : indexStrategy.getSubStrategies()) {
@@ -545,13 +542,7 @@ public Iterator<GridCoverage> convertToIndex(
545542
NavigableMap<Double, SubStrategy> map = substrategyMap.tailMap(
546543
fullRes,
547544
false);
548-
final double toKey = maxSpan / tileSize;
549-
if (map.firstKey() <= toKey) {
550-
map = map.headMap(
551-
toKey,
552-
true);
553-
pyramidLevels.addAll(map.values());
554-
}
545+
pyramidLevels.addAll(map.values());
555546
}
556547
if (pyramidLevels.isEmpty()) {
557548
// this case shouldn't occur theoretically, but just in case,

extensions/adapters/raster/src/main/java/mil/nga/giat/geowave/adapter/raster/stats/HistogramStatistics.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.io.ObjectOutputStream;
88
import java.nio.ByteBuffer;
99
import java.util.ArrayList;
10+
import java.util.Arrays;
1011
import java.util.HashMap;
1112
import java.util.HashSet;
1213
import java.util.List;
@@ -62,10 +63,10 @@ public HistogramStatistics(
6263

6364
@Override
6465
public byte[] toBinary() {
65-
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
6666
final List<byte[]> perEntryBinary = new ArrayList<byte[]>();
6767
int totalBytes = 4;
6868
for (final Entry<Resolution, javax.media.jai.Histogram> entry : histograms.entrySet()) {
69+
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
6970
byte[] keyBytes;
7071
byte[] valueBytes = new byte[] {};
7172
if (entry.getKey() != null) {

0 commit comments

Comments
 (0)