comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 2251:c9c788eea200

Improved reference curve. flys-artifacts/trunk@3900 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 03 Feb 2012 13:49:16 +0000
parents 9dc81827b187
children dd93a8e1377a
comparison
equal deleted inserted replaced
2250:40608c82e9cb 2251:c9c788eea200
683 683
684 return calc5.calculate(wst); 684 return calc5.calculate(wst);
685 } 685 }
686 686
687 687
688 /** Get reference (start) km. */
688 protected Double getReferenceStartKm() { 689 protected Double getReferenceStartKm() {
689 if (true) { 690 StateData sd = getData("reference.startpoint");
690 return FLYSUtils.getLocations(this)[0];
691 }
692
693 StateData sd = getData("reference_start");
694 691
695 if (sd == null) { 692 if (sd == null) {
696 logger.warn("no reference start given."); 693 logger.warn("no reference start given.");
697 return null; 694 return null;
698 } 695 }
699 696
700 String input = (String)sd.getValue(); 697 logger.debug("Reference start km given: " + sd.getValue());
698
699 String input = (String) sd.getValue();
701 700
702 if (input == null | (input = input.trim()).length() == 0) { 701 if (input == null | (input = input.trim()).length() == 0) {
703 logger.warn("reference start string is empty."); 702 logger.warn("reference start string is empty.");
704 return null; 703 return null;
705 } 704 }
712 } 711 }
713 712
714 return null; 713 return null;
715 } 714 }
716 715
716
717 protected double [] getReferenceEndKms() { 717 protected double [] getReferenceEndKms() {
718 StateData sd = getData("reference_end"); 718 StateData sd = getData("reference.endpoint");
719
720 if(true)
721 return new double[] {getReferenceStartKm() + 2.0d};
722 719
723 if (sd == null) { 720 if (sd == null) {
724 logger.warn("no reference end given."); 721 logger.warn("no reference end given.");
725 return null; 722 return null;
726 } 723 }
727 724 else {
728 String input = (String)sd.getValue(); 725 logger.debug("Reference end km : " + sd.getValue());
726 }
727
728 String input = (String) sd.getValue();
729 729
730 if (input == null | (input = input.trim()).length() == 0) { 730 if (input == null | (input = input.trim()).length() == 0) {
731 logger.warn("reference end string is empty."); 731 logger.warn("reference end string is empty.");
732 return null; 732 return null;
733 } 733 }

http://dive4elements.wald.intevation.org