Changeset 32082 in osm for applications/editors/josm/plugins/seachart/jrender
- Timestamp:
- 2016-02-27T09:09:45+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java
r31846 r32082 35 35 import s57.S57osm; 36 36 import s57.S57map.*; 37 import symbols.*;38 37 import render.*; 39 38 … … 53 52 static class Context implements ChartContext { 54 53 55 static double top = 0;56 static double mile = 0;54 static double top; 55 static double mile; 57 56 58 57 public Context () { … … 75 74 } 76 75 77 public Color background() { 76 public Color background(S57map map) { 78 77 return new Color(0, true); 79 78 } … … 88 87 context = new Context(); 89 88 90 int size = 256;91 for (int i = 0; i < (12 - zoom); i++) size *= 2; 89 int size = 768; 90 // for (int i = 0; i < (12 - zoom); i++) size *= 2; 92 91 Rectangle rect = new Rectangle(size, size); 93 img = new BufferedImage(rect.width, rect.height, BufferedImage.TYPE_INT_ARGB); 94 Renderer.reRender(img.createGraphics(), rect, zoom, 0.05, map, context); 95 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 96 ImageIO.write(img, "png", bos); 92 // img = new BufferedImage(rect.width, rect.height, BufferedImage.TYPE_INT_ARGB); 93 // Renderer.reRender(img.createGraphics(), rect, zoom, 0.05, map, context); 94 // ByteArrayOutputStream bos = new ByteArrayOutputStream(); 95 // ImageIO.write(img, "png", bos); 97 96 // empty = bos.size(); 98 97 // tile(zoom, 1, 0, 0); 99 FileOutputStream fos = new FileOutputStream(dstdir + "tst_" + zoom + "-" + xtile + "-" + ytile + ".png"); 100 bos.writeTo(fos); 101 fos.close(); 98 // FileOutputStream fos = new FileOutputStream(dstdir + "tst_" + zoom + "-" + xtile + "-" + ytile + ".png"); 99 // bos.writeTo(fos); 100 // fos.close(); 102 101 103 102 // for (int z = 12; z <= 18; z++) { … … 110 109 svgGenerator.setClip(rect.x, rect.y, rect.width, rect.height); 111 110 // svgGenerator.translate(-256, -256); 112 Renderer.reRender(svgGenerator, rect, zoom, 0.05, map, context); 113 svgGenerator.stream(dstdir + "tst_" + zoom + "-" + xtile + "-" + ytile + ".svg"); 111 Renderer.reRender(svgGenerator, rect, zoom, 1.0, map, context); 112 // svgGenerator.stream(dstdir + "tst_" + zoom + "-" + xtile + "-" + ytile + ".svg"); 113 svgGenerator.stream(dstdir); 114 114 // } 115 115 } … … 180 180 send = new ArrayList<String>(); 181 181 deletes = new HashMap<String, Boolean>(); 182 BufferedReader in = new BufferedReader(new FileReader(srcdir + zoom + "-" + xtile + "-" + ytile + ".osm")); 182 // BufferedReader in = new BufferedReader(new FileReader(srcdir + zoom + "-" + xtile + "-" + ytile + ".osm")); 183 BufferedReader in = new BufferedReader(new FileReader(srcdir)); 183 184 map = new S57map(true); 184 S57osm.OSMmap(in, map); 185 S57osm.OSMmap(in, map, false); 185 186 in.close(); 186 if (zoom == 12) { 187 clean(12, 0, 0); 188 } 187 // if (zoom == 12) { 188 // clean(12, 0, 0); 189 // } 189 190 tileMap(dstdir, zoom); 190 if ((send.size() + deletes.size()) > 0) { 191 PrintWriter writer = new PrintWriter(srcdir + zoom + "-" + xtile + "-" + ytile + ".send", "UTF-8"); 192 for (String str : send) { 193 writer.println(str); 194 } 195 for (String del : deletes.keySet()) { 196 writer.println("rm " + del); 197 } 198 writer.close(); 199 } 191 // if ((send.size() + deletes.size()) > 0) { 192 // PrintWriter writer = new PrintWriter(srcdir + zoom + "-" + xtile + "-" + ytile + ".send", "UTF-8"); 193 // for (String str : send) { 194 // writer.println(str); 195 // } 196 // for (String del : deletes.keySet()) { 197 // writer.println("rm " + del); 198 // } 199 // writer.close(); 200 // } 200 201 System.exit(0); 201 202 }
Note:
See TracChangeset
for help on using the changeset viewer.