Changeset 30738 in osm for applications/editors/josm/plugins/dataimport
- Timestamp:
- 2014-10-19T01:27:04+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/TangoGPS.java
r30737 r30738 30 30 31 31 /** 32 * @author dmuecke Data import for TangoGPS file format. 32 * Data import for TangoGPS file format. 33 * @author dmuecke 33 34 */ 34 35 public class TangoGPS extends FileImporter { … … 40 41 /** 41 42 * @author cbrill 42 * This function imports data from file and adds trackpoints 43 * to a layer. 43 * This function imports data from file and adds trackpoints to a layer. 44 44 * Read a log file from TangoGPS. These are simple text files in the 45 45 * form: <lat>,<lon>,<elevation>,<speed>,<course>,<hdop>,<datetime> … … 53 53 int failure = 0; 54 54 55 BufferedReader rd = null; 56 try { 55 try ( 57 56 InputStream source = new FileInputStream(file); 58 rd = new BufferedReader(new InputStreamReader(source));59 57 BufferedReader rd = new BufferedReader(new InputStreamReader(source)); 58 ) { 60 59 String line; 61 60 while ((line = rd.readLine()) != null) { … … 72 71 imported++; 73 72 } catch (NumberFormatException e) { 74 e.printStackTrace();73 Main.error(e); 75 74 } 76 75 } … … 92 91 } 93 92 showInfobox(imported,failure); 94 } finally {95 if (rd != null) {96 rd.close();97 }98 93 } 99 94 } … … 106 101 if (lineElements.length < 2) 107 102 return null; 108 return new LatLon(parseCoord(lineElements[0]), 109 parseCoord(lineElements[1])); 103 return new LatLon(parseCoord(lineElements[0]), parseCoord(lineElements[1])); 110 104 } 111 105 … … 118 112 } 119 113 } 120 121 122 114 }
Note:
See TracChangeset
for help on using the changeset viewer.