comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java @ 4750:60398ab6129a

W80Parser: Actually add points while parsing w80 file.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 03 Jan 2013 10:00:13 +0100
parents 3028037c6293
children ee6c0f246b28
comparison
equal deleted inserted replaced
4749:3028037c6293 4750:60398ab6129a
186 * Called for each line. Try to extract info from a da66 line. 186 * Called for each line. Try to extract info from a da66 line.
187 */ 187 */
188 @Override 188 @Override
189 protected void handleLine(int lineNum, String line) { 189 protected void handleLine(int lineNum, String line) {
190 String pointId = line.substring(0,20); 190 String pointId = line.substring(0,20);
191 String station = line.substring(9,16);
192 String pointIndex = line.substring(16,21);
193 // For GK, first seven digits are of interest.
191 String gkRight = line.substring(20,30); 194 String gkRight = line.substring(20,30);
192 String gkHigh = line.substring(30,40); 195 String gkHigh = line.substring(30,40);
193 String date = line.substring(40,46); 196 String date = line.substring(40,46);
194 String locType = line.substring(46,47); 197 String locType = line.substring(46,47);
195 String height = line.substring(47,54); 198 String height = line.substring(47,54);
197 String typeH = line.substring(60,61); 200 String typeH = line.substring(60,61);
198 String kindH = line.substring(61,64); 201 String kindH = line.substring(61,64);
199 String dateDec = line.substring(64,70); 202 String dateDec = line.substring(64,70);
200 String note = line.substring(70,78); 203 String note = line.substring(70,78);
201 String actual = line.substring(78); 204 String actual = line.substring(78);
205 double stationKm = Double.parseDouble(station) / 1000d;
206 double gkRightKm = Double.parseDouble(gkRight.substring(0,7));
207 double gkHighKm = Double.parseDouble(gkHigh.substring(0,7));
208 double heightM = Double.parseDouble(height);
209
210 // New (or first) line.
211 if (anchor == null || anchor.getStation() != stationKm) {
212 this.anchor = new Anchor(new Coordinate(gkRightKm, gkHighKm, heightM), stationKm);
213 currentLine = new ArrayList<XY>();
214 data.put(stationKm, currentLine);
215 currentLine.add(new XY(0d, heightM,0));
216 }
217 else {
218 addPoint(gkRightKm, gkHighKm, heightM, pointIndex);
219 }
202 } 220 }
203 221
204 222
205 /** Called when file is fully consumed. */ 223 /** Called when file is fully consumed. */
206 @Override 224 @Override

http://dive4elements.wald.intevation.org