Issue #978 GChange GridResource to use its own times rather than descriptor times.

Former-commit-id: 090b9f5ccb [formerly 8346805ed2 [formerly 1481f818fed5ff9f18387d8fcbd9c30da37a9dd7]]
Former-commit-id: 8346805ed2
Former-commit-id: c5c9e8b05c
This commit is contained in:
Ben Steffensmeier 2012-08-03 15:52:47 -05:00
parent 1d953096d4
commit d841924588

View file

@ -307,11 +307,12 @@ public class GridResource extends
.getLocation().getGridGeometry(); .getLocation().getGridGeometry();
GridGeometry2D expectedGridGeometry = this.gridGeometry[0]; GridGeometry2D expectedGridGeometry = this.gridGeometry[0];
if (!realGridGeometry.equals(expectedGridGeometry)) { if (!realGridGeometry.equals(expectedGridGeometry)) {
GridReprojection reproj = new GridReprojection(realGridGeometry, GridReprojection reproj = new GridReprojection(
expectedGridGeometry); realGridGeometry, expectedGridGeometry);
com.raytheon.uf.common.geospatial.interpolation.Interpolation interp; com.raytheon.uf.common.geospatial.interpolation.Interpolation interp;
if (getCapability(ImagingCapability.class).isInterpolationState()) { if (getCapability(ImagingCapability.class)
.isInterpolationState()) {
BilinearInterpolation blInterp = new BilinearInterpolation(); BilinearInterpolation blInterp = new BilinearInterpolation();
blInterp.setMissingThreshold(1.0f); blInterp.setMissingThreshold(1.0f);
interp = blInterp; interp = blInterp;
@ -849,11 +850,11 @@ public class GridResource extends
baseTileEntry.setValue(combinedResourceData); baseTileEntry.setValue(combinedResourceData);
} }
} }
DataTime[] primaryDataTimes = descriptor.getTimeMatchingMap().get( DataTime[] primaryDataTimes = tileSet.keySet().toArray(
this); new DataTime[0]);
for (int i = 0; i < primaryDataTimes.length; i++) { for (DataTime primaryDataTime : primaryDataTimes) {
Map<Float, GridMemoryBasedTileSet> map = tileSet Map<Float, GridMemoryBasedTileSet> map = tileSet
.get(primaryDataTimes[i]); .get(primaryDataTime);
if (map != null) { if (map != null) {
for (Map.Entry<Float, GridMemoryBasedTileSet> tile : map for (Map.Entry<Float, GridMemoryBasedTileSet> tile : map
.entrySet()) { .entrySet()) {
@ -861,7 +862,7 @@ public class GridResource extends
if (combineResources) { if (combineResources) {
Map<Float, GridMemoryBasedTileSet> map2 = new HashMap<Float, GridResource.GridMemoryBasedTileSet>(); Map<Float, GridMemoryBasedTileSet> map2 = new HashMap<Float, GridResource.GridMemoryBasedTileSet>();
map2.put(tile.getKey(), tile.getValue()); map2.put(tile.getKey(), tile.getValue());
combinedSet.put(primaryDataTimes[i], map2); combinedSet.put(primaryDataTime, map2);
} }
continue; continue;
} }
@ -873,7 +874,7 @@ public class GridResource extends
.getValue()); .getValue());
Map<Float, GridMemoryBasedTileSet> map2 = new HashMap<Float, GridResource.GridMemoryBasedTileSet>(); Map<Float, GridMemoryBasedTileSet> map2 = new HashMap<Float, GridResource.GridMemoryBasedTileSet>();
map2.put(tile.getKey(), combinedResourceData); map2.put(tile.getKey(), combinedResourceData);
combinedSet.put(primaryDataTimes[i], map2); combinedSet.put(primaryDataTime, map2);
} }
} }
} }
@ -1520,7 +1521,8 @@ public class GridResource extends
// TODO: check if interpolation state really changed // TODO: check if interpolation state really changed
try { try {
if (descriptor != null) if (descriptor != null)
project(descriptor.getGridGeometry().getCoordinateReferenceSystem()); project(descriptor.getGridGeometry()
.getCoordinateReferenceSystem());
} catch (VizException e) { } catch (VizException e) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
"Error updating grid resource imaging", e); "Error updating grid resource imaging", e);