Changeset 36169 in osm for applications/editors/josm/plugins
- Timestamp:
- 2023-10-12T21:13:32+02:00 (13 months ago)
- Location:
- applications/editors/josm/plugins/seachart
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/jrenderpgsql/src/jrenderpgsql/JrenderPgsql.java
r35110 r36169 7 7 import java.awt.geom.Point2D; 8 8 import java.awt.image.BufferedImage; 9 import java.io.B ufferedReader;9 import java.io.ByteArrayInputStream; 10 10 import java.io.StringReader; 11 11 import java.io.ByteArrayOutputStream; 12 12 import java.io.FileOutputStream; 13 import java.nio.charset.StandardCharsets; 13 14 import java.util.ArrayList; 14 15 import java.util.HashMap; … … 396 397 // library where it will be parsed again. 397 398 398 B ufferedReader in = new BufferedReader(new StringReader(combinedBuf.toString()));399 ByteArrayInputStream in = new ByteArrayInputStream(combinedBuf.toString().getBytes(StandardCharsets.UTF_8)); 399 400 map = new S57map(true); 400 401 S57osm.OSMmap(in, map, false); … … 427 428 public RuleSet ruleset() { 428 429 return RuleSet.SEAMARK; 430 } 431 432 public Chart chart() { 433 return null; 434 } 435 436 public int grid() { 437 return 0; 429 438 } 430 439 }; -
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.