comparison 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
comparison
equal deleted inserted replaced
592:3c939c95c477 593:b248531fa20b
520 AreaInterpolation interpolation = 520 AreaInterpolation interpolation =
521 new AreaInterpolation(); 521 new AreaInterpolation();
522 522
523 int numSamples = numSamples(callContext); 523 int numSamples = numSamples(callContext);
524 int groundInterpolation = getGroundInterpolation(callContext); 524 int groundInterpolation = getGroundInterpolation(callContext);
525 int extrapolationRounds = extrapolationRounds(callContext);
525 526
526 if (!interpolation.interpolate( 527 if (!interpolation.interpolate(
527 input.getPoints(), 528 input.getPoints(),
528 boundingBox, 529 boundingBox,
529 new Dimension(numSamples, numSamples), 530 new Dimension(numSamples, numSamples),
530 new QueriedXYDepth(groundInterpolation) 531 new QueriedXYDepth(groundInterpolation),
532 extrapolationRounds
531 )) { 533 )) {
532 log.error("interpolation failed"); 534 log.error("interpolation failed");
533 return null; 535 return null;
534 } 536 }
535 537
632 Integer samples = (Integer)context.get( 634 Integer samples = (Integer)context.get(
633 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_SAMPLES_KEY); 635 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_SAMPLES_KEY);
634 return samples != null 636 return samples != null
635 ? samples.intValue() 637 ? samples.intValue()
636 : GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_SAMPLES; 638 : GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_SAMPLES;
639 }
640
641 private static int extrapolationRounds(CallContext callContext) {
642 GNVArtifactContext context =
643 (GNVArtifactContext)callContext.globalContext();
644 Integer extrapolationRounds = (Integer)context.get(
645 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS_KEY);
646 return extrapolationRounds != null
647 ? extrapolationRounds.intValue()
648 : GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS;
637 } 649 }
638 650
639 private static File shapefileDirectory(CallContext callContext) { 651 private static File shapefileDirectory(CallContext callContext) {
640 GNVArtifactContext context = 652 GNVArtifactContext context =
641 (GNVArtifactContext)callContext.globalContext(); 653 (GNVArtifactContext)callContext.globalContext();

http://dive4elements.wald.intevation.org