From d841924588c1aee7bda9443b0db94a6ecdf0772a Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Fri, 3 Aug 2012 15:52:47 -0500 Subject: [PATCH] Issue #978 GChange GridResource to use its own times rather than descriptor times. Former-commit-id: 090b9f5ccb029f9152e939a62c26549eda829f20 [formerly 8346805ed2df0b31a9a9b21c361b9dd12a3e5feb [formerly 1481f818fed5ff9f18387d8fcbd9c30da37a9dd7]] Former-commit-id: 8346805ed2df0b31a9a9b21c361b9dd12a3e5feb Former-commit-id: c5c9e8b05c43dd9d9957fd6c23e51e95730e5558 --- .../raytheon/viz/grid/rsc/GridResource.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java index a2018fce3e..6ae4499d6a 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java @@ -307,11 +307,12 @@ public class GridResource extends .getLocation().getGridGeometry(); GridGeometry2D expectedGridGeometry = this.gridGeometry[0]; if (!realGridGeometry.equals(expectedGridGeometry)) { - GridReprojection reproj = new GridReprojection(realGridGeometry, - expectedGridGeometry); - com.raytheon.uf.common.geospatial.interpolation.Interpolation interp; + GridReprojection reproj = new GridReprojection( + realGridGeometry, expectedGridGeometry); + com.raytheon.uf.common.geospatial.interpolation.Interpolation interp; - if (getCapability(ImagingCapability.class).isInterpolationState()) { + if (getCapability(ImagingCapability.class) + .isInterpolationState()) { BilinearInterpolation blInterp = new BilinearInterpolation(); blInterp.setMissingThreshold(1.0f); interp = blInterp; @@ -849,11 +850,11 @@ public class GridResource extends baseTileEntry.setValue(combinedResourceData); } } - DataTime[] primaryDataTimes = descriptor.getTimeMatchingMap().get( - this); - for (int i = 0; i < primaryDataTimes.length; i++) { + DataTime[] primaryDataTimes = tileSet.keySet().toArray( + new DataTime[0]); + for (DataTime primaryDataTime : primaryDataTimes) { Map map = tileSet - .get(primaryDataTimes[i]); + .get(primaryDataTime); if (map != null) { for (Map.Entry tile : map .entrySet()) { @@ -861,7 +862,7 @@ public class GridResource extends if (combineResources) { Map map2 = new HashMap(); map2.put(tile.getKey(), tile.getValue()); - combinedSet.put(primaryDataTimes[i], map2); + combinedSet.put(primaryDataTime, map2); } continue; } @@ -873,7 +874,7 @@ public class GridResource extends .getValue()); Map map2 = new HashMap(); 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 try { if (descriptor != null) - project(descriptor.getGridGeometry().getCoordinateReferenceSystem()); + project(descriptor.getGridGeometry() + .getCoordinateReferenceSystem()); } catch (VizException e) { statusHandler.handle(Priority.PROBLEM, "Error updating grid resource imaging", e);