comparison backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java @ 7183:0fe00824bd96

flys/issue1500: The main wst file determines km_up now.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 27 Sep 2013 12:11:54 +0200
parents 0baf7abffcc6
children 7fabae60428b c894b7b45c4c
comparison
equal deleted inserted replaced
7182:87c32adb7088 7183:0fe00824bd96
939 } 939 }
940 940
941 WstParser wstParser = new WstParser(); 941 WstParser wstParser = new WstParser();
942 wstParser.parse(wstFile); 942 wstParser.parse(wstFile);
943 wst = wstParser.getWst(); 943 wst = wstParser.getWst();
944 wst.setKmUp(wst.guessWaterLevelIncreasing());
944 } 945 }
945 946
946 public void parseGauges() throws IOException { 947 public void parseGauges() throws IOException {
947 if (Config.INSTANCE.skipGauges()) { 948 if (Config.INSTANCE.skipGauges()) {
948 log.info("skip parsing gauges"); 949 log.info("skip parsing gauges");
1208 } 1209 }
1209 } 1210 }
1210 } 1211 }
1211 1212
1212 public void storeWst() { 1213 public void storeWst() {
1213 if (!Config.INSTANCE.skipWst()) { 1214 if (wst != null && !Config.INSTANCE.skipWst()) {
1214 River river = getPeer(); 1215 River river = getPeer();
1215 wst.storeDependencies(river); 1216 wst.storeDependencies(river);
1217
1218 // The flow direction of the main wst and the corresponding
1219 // waterlevels determine if the river is 'km_up'.
1220 Session session = ImporterSession.getInstance().getDatabaseSession();
1221 river.setKmUp(wst.getKmUp());
1222 session.save(river);
1216 } 1223 }
1217 } 1224 }
1218 1225
1219 public void storeFixations() { 1226 public void storeFixations() {
1220 if (!Config.INSTANCE.skipFixations()) { 1227 if (!Config.INSTANCE.skipFixations()) {

http://dive4elements.wald.intevation.org