Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java @ 6335:b2a470c148a7
Backend: First steps to integrate parsing of official config files.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 14 Jun 2013 13:01:26 +0200 |
parents | e81e9dcc81b4 |
children | 224d7c4b5291 |
comparison
equal
deleted
inserted
replaced
6334:9231940bd192 | 6335:b2a470c148a7 |
---|---|
22 import org.dive4elements.river.importer.parsers.FlowVelocityMeasurementParser; | 22 import org.dive4elements.river.importer.parsers.FlowVelocityMeasurementParser; |
23 import org.dive4elements.river.importer.parsers.FlowVelocityModelParser; | 23 import org.dive4elements.river.importer.parsers.FlowVelocityModelParser; |
24 import org.dive4elements.river.importer.parsers.HYKParser; | 24 import org.dive4elements.river.importer.parsers.HYKParser; |
25 import org.dive4elements.river.importer.parsers.MeasurementStationsParser; | 25 import org.dive4elements.river.importer.parsers.MeasurementStationsParser; |
26 import org.dive4elements.river.importer.parsers.MorphologicalWidthParser; | 26 import org.dive4elements.river.importer.parsers.MorphologicalWidthParser; |
27 import org.dive4elements.river.importer.parsers.OfficialLinesConfigParser; | |
27 import org.dive4elements.river.importer.parsers.PRFParser; | 28 import org.dive4elements.river.importer.parsers.PRFParser; |
28 import org.dive4elements.river.importer.parsers.PegelGltParser; | 29 import org.dive4elements.river.importer.parsers.PegelGltParser; |
29 import org.dive4elements.river.importer.parsers.SQRelationParser; | 30 import org.dive4elements.river.importer.parsers.SQRelationParser; |
30 import org.dive4elements.river.importer.parsers.SedimentDensityParser; | 31 import org.dive4elements.river.importer.parsers.SedimentDensityParser; |
31 import org.dive4elements.river.importer.parsers.SedimentYieldParser; | 32 import org.dive4elements.river.importer.parsers.SedimentYieldParser; |
72 "Basisdaten", | 73 "Basisdaten", |
73 "Fixierungen" }; | 74 "Fixierungen" }; |
74 | 75 |
75 public static final String OFFICIAL_LINES = | 76 public static final String OFFICIAL_LINES = |
76 "Amtl_Linien.wst"; | 77 "Amtl_Linien.wst"; |
78 | |
79 public static final String OFFICIAL_LINES_CONFIG = | |
80 "Amtl_Linien.config"; | |
77 | 81 |
78 public static final String FLOOD_WATER = "HW-Marken"; | 82 public static final String FLOOD_WATER = "HW-Marken"; |
79 | 83 |
80 public static final String FLOOD_PROTECTION = | 84 public static final String FLOOD_PROTECTION = |
81 "HW-Schutzanlagen"; | 85 "HW-Schutzanlagen"; |
791 WstParser wstParser = new WstParser(); | 795 WstParser wstParser = new WstParser(); |
792 wstParser.parse(file); | 796 wstParser.parse(file); |
793 ImportWst iw = wstParser.getWst(); | 797 ImportWst iw = wstParser.getWst(); |
794 iw.setKind(3); | 798 iw.setKind(3); |
795 iw.setDescription(folder + "/" + iw.getDescription()); | 799 iw.setDescription(folder + "/" + iw.getDescription()); |
800 | |
801 File configFile = FileTools.repair(new File(dir, OFFICIAL_LINES_CONFIG)); | |
802 if (!configFile.isFile() || !configFile.canRead()) { | |
803 log.warn("no config file for official lines found"); | |
804 } | |
805 else { | |
806 OfficialLinesConfigParser olcp = new OfficialLinesConfigParser(); | |
807 try { | |
808 olcp.parse(configFile); | |
809 } | |
810 catch (IOException ioe) { | |
811 log.warn("Error reading offical lines config", ioe); | |
812 } | |
813 List<String> mainValueNames = olcp.getMainValueNames(); | |
814 if (mainValueNames.isEmpty()) { | |
815 log.warn("config file for offical lines contains no entries"); | |
816 } | |
817 else { | |
818 // TODO: Join against main values. | |
819 } | |
820 } | |
821 | |
796 officialLines.add(iw); | 822 officialLines.add(iw); |
797 } // for all folders | 823 } // for all folders |
798 | 824 |
799 } | 825 } |
800 | 826 |