Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java @ 463:07672838fa5f
Make ground interpolation for vertical cross section configurable.
gnv-artifacts/trunk@522 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sat, 09 Jan 2010 16:58:53 +0000 |
parents | 912797826099 |
children | ab29e4ff2fda |
comparison
equal
deleted
inserted
replaced
462:912797826099 | 463:07672838fa5f |
---|---|
82 import de.intevation.gnv.raster.Vectorizer; | 82 import de.intevation.gnv.raster.Vectorizer; |
83 | 83 |
84 import de.intevation.gnv.jfreechart.PolygonDataset; | 84 import de.intevation.gnv.jfreechart.PolygonDataset; |
85 import de.intevation.gnv.jfreechart.PolygonSeries; | 85 import de.intevation.gnv.jfreechart.PolygonSeries; |
86 | 86 |
87 import de.intevation.gnv.geobackend.sde.datasources.RasterObject; | |
88 | |
87 /** | 89 /** |
88 * @author Tim Englich (tim.englich@intevation.de) | 90 * @author Tim Englich (tim.englich@intevation.de) |
89 * @author Ingo Weinzierl (iweinzierl@intevation.de) | 91 * @author Ingo Weinzierl (iweinzierl@intevation.de) |
90 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) | 92 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) |
91 */ | 93 */ |
178 callContext); | 180 callContext); |
179 | 181 |
180 CacheFactory.getInstance().getCache().put(new Element(key, obj)); | 182 CacheFactory.getInstance().getCache().put(new Element(key, obj)); |
181 | 183 |
182 return obj; | 184 return obj; |
185 } | |
186 | |
187 private static int getGroundInterpolation(CallContext callContext) { | |
188 GNVArtifactContext context = | |
189 (GNVArtifactContext)callContext.globalContext(); | |
190 | |
191 String interpolation = (String)context.get( | |
192 GNVArtifactContext.VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION_KEY); | |
193 | |
194 return RasterObject.getInterpolationType(interpolation); | |
183 } | 195 } |
184 | 196 |
185 private static Dimension getRasterSize(CallContext callContext) { | 197 private static Dimension getRasterSize(CallContext callContext) { |
186 GNVArtifactContext context = | 198 GNVArtifactContext context = |
187 (GNVArtifactContext)callContext.globalContext(); | 199 (GNVArtifactContext)callContext.globalContext(); |
263 path, | 275 path, |
264 columns.getXYColumns(), | 276 columns.getXYColumns(), |
265 0d, | 277 0d, |
266 distance, | 278 distance, |
267 LinearMetrics.INSTANCE, | 279 LinearMetrics.INSTANCE, |
268 new QueriedXYDepth()); | 280 new QueriedXYDepth( |
269 //new ConstantXYDepth(-75d)); // TODO: Use DEM here!! | 281 getGroundInterpolation(callContext))); |
270 | 282 |
271 if (!success) { | 283 if (!success) { |
272 log.warn("interpolation failed"); | 284 log.warn("interpolation failed"); |
273 return null; | 285 return null; |
274 } | 286 } |