Mercurial > dive4elements > river
annotate flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java @ 4751:ee6c0f246b28
W80Parser: Added TODO/comment.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 03 Jan 2013 10:21:46 +0100 |
parents | 60398ab6129a |
children | ba8c2147b4ff |
rev | line source |
---|---|
4728
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.importer.parsers; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
4735
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
3 import de.intevation.artifacts.common.utils.FileTools; |
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
4 |
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
5 import de.intevation.flys.importer.XY; |
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
6 |
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
7 import de.intevation.flys.utils.EpsilonComparator; |
4747
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
8 import de.intevation.flys.importer.parsers.tim.Coordinate; |
4735
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
9 |
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
10 import java.io.File; |
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
11 import java.io.IOException; |
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
12 |
4728
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 import java.util.ArrayList; |
4735
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
14 import java.util.List; |
4728
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 import java.util.Map; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 import java.util.TreeMap; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 import java.util.regex.Pattern; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 import org.apache.log4j.Logger; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 /** |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 * To create cross-sections, generate: Map<double,list<xy>> from files |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 * in da66 format. |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 public class W80Parser extends LineParser implements CrossSectionParser |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 /** Private logger. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 private static Logger logger = Logger.getLogger(W80Parser.class); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 /** Regex to match lines of files in da66 format. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 private static final Pattern LINE_PATTERN = |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 Pattern.compile("[\\p{Alnum} ]{20}" + // ID |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 "[0-9 ]{10} " + // GK-right |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 "[0-9 ]{10} " + // GK-left |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 "[0-9 ]{6} " + // date |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 "[0-9 ]{1} " + // kind of exactness of measurement |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 "[0-9 ]{7} " + // height |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 "[0-9 ]{6} " + // date of height |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 "[0-9 ]{1} " + // kind of exactness of height-measurement |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 "[0-9 ]{3} " + // kind (only for NIV-points) |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 "[\\p{Alnum} ]{6} " + // date of point decline |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 "[\\p{Alnum} ]{8} " + // note for point |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 "[0-9 ]{2} " // actuality |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 ); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 // TODO define headers regex, use regex or remove it. |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
51 /** The current line to which add points. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 private List<XY> currentLine; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 /** Data collected so far, last element will be currentLine. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 protected Map<Double, List<XY>> data; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 |
4747
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
59 /** Anchor to project to. */ |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
60 private class Anchor { |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
61 private Coordinate coordinate; |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
62 private double station; |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
63 public Anchor(Coordinate anchor, double station) { |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
64 this.coordinate = anchor; |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
65 this.station = station; |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
66 } |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
67 public double getStation() { |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
68 return station; |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
69 } |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
70 public Coordinate getCoordinate() { |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
71 return coordinate; |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
72 } |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
73 } |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
74 |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
75 |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
76 private Anchor anchor; |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
77 |
2a6d64a415e4
W80Parser: Put infrastructure for an anchor point in place.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
78 |
4728
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 /** Trivial constructor. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
80 public W80Parser() { |
4735
94b39073f0f7
Moved EpsilonComparator to utils package becaus its not only useful for TIM parsing. Used EpsilonComparator in DA60 and DA66 case. Maybe TODO: Use in PRF, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4733
diff
changeset
|
81 data = new TreeMap<Double, List<XY>>(EpsilonComparator.CMP); |
4728
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
83 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
84 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
85 /** Get the description of the cross section parsed. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
86 @Override |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 public String getDescription() { |
4729
0df1cac6c4b5
Removed removeExtension implementations, which have been moved to FileTools,
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4728
diff
changeset
|
88 return FileTools.removeExtension(getFileName()); |
4728
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 /** Get the year of this cross sections measurement. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 @Override |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 public Integer getYear() { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 return null; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 /** |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 * Return the data parsed. |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 * @return map of stations (km) to list of points. |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 @Override |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 public Map<Double, List<XY>> getData() { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 return data; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
106 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
108 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
109 public void parseW80s(File root, final Callback callback) { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
110 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
111 // TODO use the removeExtension/guess description and date. |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
112 FileTools.walkTree(root, new FileTools.FileVisitor() { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
113 @Override |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
114 public boolean visit(File file) { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
115 if (file.isFile() && file.canRead() |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
116 && file.getName().toLowerCase().endsWith(".w80") |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
117 && (callback == null || callback.accept(file))) { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
118 reset(); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
119 try { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
120 parse(file); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
121 logger.info("parsing done"); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
122 if (callback != null) { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 callback.parsed(W80Parser.this); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
125 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
126 catch (IOException ioe) { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 logger.error("IOException while parsing file"); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
128 return false; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
129 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
130 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
131 return true; |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
132 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
133 }); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
134 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
135 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
136 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 /** Called before consuming first line of file. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 public void reset() { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
139 data.clear(); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
140 currentLine = new ArrayList<XY>(); |
4749
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
141 anchor = null; |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
142 } |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
143 |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
144 |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
145 /** |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
146 * Get the Index of the last cross-section lines point. |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
147 * @return last points index, -1 if not available. |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
148 */ |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
149 private int lastPointIdx() { |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
150 if (currentLine == null || currentLine.isEmpty()) { |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
151 return -1; |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
152 } |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
153 XY lastPoint = this.currentLine.get(currentLine.size()-1); |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
154 return lastPoint.getIndex(); |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
155 } |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
156 |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
157 /** |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
158 * Add a Point (YZ,Index) to the current cross section line. |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
159 * @param y The y coordinate of new point. |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
160 * @param z The z coordinate of new point. |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
161 * @param idx Ignored, the parameter of new point. |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
162 * @return true if point could been added, false otherwise (e.g. not |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
163 * parsable y or z values. |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
164 */ |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
165 private boolean addPoint(double gkr, double gkh, double height, String idx) { |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
166 // Calculate distance between this and anchor-point. |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
167 double dx = gkr - anchor.getCoordinate().getX(); |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
168 double dy = gkh - anchor.getCoordinate().getY(); |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
169 double d = Math.sqrt(dx * dx + dy * dy); |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
170 |
4751
ee6c0f246b28
W80Parser: Added TODO/comment.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4750
diff
changeset
|
171 // TODO: Scale to have "x==0" e.g. at axis of river. |
ee6c0f246b28
W80Parser: Added TODO/comment.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4750
diff
changeset
|
172 // TODO: Handle "not straight lines." |
ee6c0f246b28
W80Parser: Added TODO/comment.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4750
diff
changeset
|
173 |
4749
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
174 // We ignore idx, and increment instead. |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
175 int index; |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
176 int lastPointIdx = lastPointIdx(); |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
177 if (lastPointIdx <= 0) { |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
178 index = 1; |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
179 } else { |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
180 index = lastPointIdx + 1; |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
181 } |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
182 |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
183 currentLine.add(new XY(d, height/1000d, index)); |
3028037c6293
W80Parser: addPoint and lastIdx functions to add a point and find last points index.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4747
diff
changeset
|
184 return true; |
4728
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
185 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
186 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
187 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
188 /** |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
189 * Called for each line. Try to extract info from a da66 line. |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
190 */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
191 @Override |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
192 protected void handleLine(int lineNum, String line) { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
193 String pointId = line.substring(0,20); |
4750
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
194 String station = line.substring(9,16); |
4751
ee6c0f246b28
W80Parser: Added TODO/comment.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4750
diff
changeset
|
195 // TODO: There is 'station' and a 'shore'-code behind. |
ee6c0f246b28
W80Parser: Added TODO/comment.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4750
diff
changeset
|
196 // 1 = left, 2 = right. none = middle |
4750
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
197 String pointIndex = line.substring(16,21); |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
198 // For GK, first seven digits are of interest. |
4728
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
199 String gkRight = line.substring(20,30); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
200 String gkHigh = line.substring(30,40); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
201 String date = line.substring(40,46); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
202 String locType = line.substring(46,47); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
203 String height = line.substring(47,54); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
204 String dateH = line.substring(54,60); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
205 String typeH = line.substring(60,61); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
206 String kindH = line.substring(61,64); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
207 String dateDec = line.substring(64,70); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
208 String note = line.substring(70,78); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
209 String actual = line.substring(78); |
4750
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
210 double stationKm = Double.parseDouble(station) / 1000d; |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
211 double gkRightKm = Double.parseDouble(gkRight.substring(0,7)); |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
212 double gkHighKm = Double.parseDouble(gkHigh.substring(0,7)); |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
213 double heightM = Double.parseDouble(height); |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
214 |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
215 // New (or first) line. |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
216 if (anchor == null || anchor.getStation() != stationKm) { |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
217 this.anchor = new Anchor(new Coordinate(gkRightKm, gkHighKm, heightM), stationKm); |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
218 currentLine = new ArrayList<XY>(); |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
219 data.put(stationKm, currentLine); |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
220 currentLine.add(new XY(0d, heightM,0)); |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
221 } |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
222 else { |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
223 addPoint(gkRightKm, gkHighKm, heightM, pointIndex); |
60398ab6129a
W80Parser: Actually add points while parsing w80 file.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4749
diff
changeset
|
224 } |
4728
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
225 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
226 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
227 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
228 /** Called when file is fully consumed. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
229 @Override |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
230 protected void finish() { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
231 logger.info("Parsed " + data.size() + " lines"); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
232 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
233 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
234 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
235 /** Parses files given as arguments. */ |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
236 public static void main(String [] args) { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
237 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
238 W80Parser parser = new W80Parser(); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
239 |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
240 logger.warn("Start parsing files."); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
241 for (String arg: args) { |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
242 parser.parseW80s(new File(arg), null); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
243 logger.warn("Parsing a file."); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
244 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
245 logger.error("Finished parsing files."); |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
246 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
247 } |
ccae8b43e527
Initial empty version of W80Parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
248 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |