comparison artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java @ 7834:b2a8a94a92f9 minfo-opt

Draw lines with gaps for sounding width, and bed heights.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 03 Apr 2014 14:10:53 +0200
parents 272cbcd94688
children e844be34a606
comparison
equal deleted inserted replaced
7833:f97162606fa2 7834:b2a8a94a92f9
84 false, 84 false,
85 GAP_TOLERANCE, 85 GAP_TOLERANCE,
86 1d); 86 1d);
87 } else if (data instanceof BedHeightSingleData) { 87 } else if (data instanceof BedHeightSingleData) {
88 BedHeightSingleData bData = (BedHeightSingleData)data; 88 BedHeightSingleData bData = (BedHeightSingleData)data;
89 double[] heights = bData.getHeights(); 89 double[][] points = new double[][]
90 double[] stations = bData.getStations().toNativeArray(); 90 {bData.getStations().toNativeArray(), bData.getHeights()};
91 91
92 logger.debug("doBedheightSingleOut"); 92 logger.debug("doBedheightSingleOut");
93 93 StyledSeriesBuilder.addPointsFactorY(series,
94 for (int i = 0; i < heights.length; i++) { 94 points,
95 series.add(stations[i], heights[i], false); 95 false,
96 } 96 GAP_TOLERANCE,
97 1d);
97 } 98 }
98 else if (data instanceof List<?>) { 99 else if (data instanceof List<?>) {
99 List<BedHeightSingleValue> bData = (List<BedHeightSingleValue>)data; 100 List<BedHeightSingleValue> bData = (List<BedHeightSingleValue>)data;
101 double[][] points = new double[2][];
100 102
101 logger.debug("doBedheightSingleValueOut"); 103 logger.debug("doBedheightSingleValueOut");
102 104
103 for(BedHeightSingleValue bvalue: bData) { 105 for(int i = 0; i < bData.size(); i++) {
104 series.add(bvalue.getStation(), bvalue.getHeight()); 106 BedHeightSingleValue bvalue = bData.get(i);
107 points[0][i] = bvalue.getStation();
108 points[1][i] = bvalue.getHeight();
105 } 109 }
110 StyledSeriesBuilder.addPointsFactorY(series,
111 points,
112 false,
113 GAP_TOLERANCE,
114 1d);
106 } 115 }
107 else { 116 else {
108 logger.error("Unknown data type " + data.getClass()); 117 logger.error("Unknown data type " + data.getClass());
109 } 118 }
110 return series; 119 return series;

http://dive4elements.wald.intevation.org