diff gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java @ 593:b248531fa20b

Added experimental support for extrapolation in "Horizontalschnitte" gnv-artifacts/trunk@648 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 31 Jan 2010 21:50:15 +0000
parents f7f97edf09ba
children 567216b56983
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java	Fri Jan 29 13:28:28 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java	Sun Jan 31 21:50:15 2010 +0000
@@ -522,12 +522,14 @@
 
         int numSamples          = numSamples(callContext);
         int groundInterpolation = getGroundInterpolation(callContext);
+        int extrapolationRounds = extrapolationRounds(callContext);
 
         if (!interpolation.interpolate(
             input.getPoints(), 
             boundingBox,
             new Dimension(numSamples, numSamples),
-            new QueriedXYDepth(groundInterpolation)
+            new QueriedXYDepth(groundInterpolation),
+            extrapolationRounds
         )) {
             log.error("interpolation failed");
             return null;
@@ -636,6 +638,16 @@
             : GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_SAMPLES;
     }
 
+    private static int extrapolationRounds(CallContext callContext) {
+        GNVArtifactContext context =
+            (GNVArtifactContext)callContext.globalContext();
+        Integer extrapolationRounds = (Integer)context.get(
+            GNVArtifactContext.HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS_KEY);
+        return extrapolationRounds != null
+            ? extrapolationRounds.intValue()
+            : GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS;
+    }
+
     private static File shapefileDirectory(CallContext callContext) {
         GNVArtifactContext context =
             (GNVArtifactContext)callContext.globalContext();

http://dive4elements.wald.intevation.org