Changeset 36169 in osm for applications/editors/josm/plugins/seachart/src/s57
- Timestamp:
- 2023-10-12T21:13:32+02:00 (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/s57/S57osm.java
r35404 r36169 3 3 4 4 import java.io.File; 5 import java.io.InputStream; 6 import java.io.FileInputStream; 5 7 import java.util.ArrayList; 6 8 import java.util.HashMap; … … 98 100 } 99 101 100 public static void OSMmap(File in, S57map map, boolean bb) throws Exception { 102 public static void OSMmap(File file, S57map map, boolean bb) throws Exception { 103 try (InputStream in = new FileInputStream(file)) { 104 OSMmap(in, map, bb); 105 } 106 } 107 108 public static void OSMmap(InputStream in, S57map map, boolean bb) throws Exception { 109 DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); 110 DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); 111 Document doc = dBuilder.parse(in); 112 113 OSMmap(doc, map, bb); 114 } 115 116 public static void OSMmap(Document doc, S57map map, boolean bb) throws Exception { 101 117 double lat = 0; 102 118 double lon = 0; … … 113 129 map.nodes.put(4L, new Snode()); 114 130 115 DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();116 DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();117 Document doc = dBuilder.parse(in);118 131 doc.getDocumentElement().normalize(); 119 132 if (!doc.getDocumentElement().getNodeName().equals("osm")) {
Note:
See TracChangeset
for help on using the changeset viewer.