Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedDiffEpochFacet.java @ 4672:12e3da5724e6
Added new facets for filtered bed height diffs to have filtered and raw data.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 13 Dec 2012 17:18:53 +0100 |
parents | e3f28be45103 |
children | 756aba0d2a7a |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedDiffEpochFacet.java Thu Dec 13 15:57:09 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedDiffEpochFacet.java Thu Dec 13 17:18:53 2012 +0100 @@ -37,32 +37,8 @@ stateId, type, false); BedDiffEpochResult[] data = - (BedDiffEpochResult[]) res.getData(); // TODO CAST TO SPECIFIC CLASS - Double start = (Double)context.getContextValue("startkm"); - Double end = (Double)context.getContextValue("endkm"); - - if(start != null && end != null) { - FLYSContext fc = (FLYSContext)context.globalContext(); - ZoomScale scales = (ZoomScale)fc.get("zoomscale"); - RiverAccess access = new RiverAccess((FLYSArtifact)artifact); - String river = access.getRiver(); + (BedDiffEpochResult[]) res.getData(); - double radius = scales.getRadius(river, start, end); - BedDiffEpochResult oldData = data[index]; - BedDiffEpochResult newData = new BedDiffEpochResult(); - newData.setStart(oldData.getStart()); - newData.setEnd(oldData.getEnd()); - double[][] diffs = MovingAverage.weighted(oldData.getDifferencesData(), radius); - double[][] heights1 = MovingAverage.weighted(oldData.getHeights1Data(), radius); - double[][] heights2 = MovingAverage.weighted(oldData.getHeights2Data(), radius); - for(int j = 0; j < diffs[0].length; j++) { - newData.addKm(diffs[0][j]); - newData.addDifference(diffs[1][j]); - newData.addHeight1(heights1[1][j]); - newData.addHeight2(heights2[1][j]); - } - return newData; - } return data != null && data.length > index ? data[index] : null; }