Changeset 31027 in osm for applications/editors/josm/plugins/seachart/jrender/src
- Timestamp:
- 2015-02-19T21:52:40+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java
r30894 r31027 33 33 import render.ChartContext; 34 34 import render.Renderer; 35 import render.Rules; 35 36 import s57.S57map; 36 37 import s57.S57map.Feature; … … 154 155 } 155 156 } else if (ln.contains("</osm")) { 157 map.mapDone(); 156 158 inOsm = false; 157 159 break; … … 167 169 type = (token.split("[\"\']")[1]); 168 170 } else if (token.matches("^role=.+")) { 169 role = (token.split("[\"\']")[1]); 171 String str[] = token.split("[\"\']"); 172 if (str.length > 1) { 173 role = (token.split("[\"\']")[1]); 174 } 170 175 } 171 176 } … … 193 198 inOsm = true; 194 199 map = new S57map(); 200 map.addNode(1, maxlat, minlon); 201 map.addNode(2, minlat, minlon); 202 map.addNode(3, minlat, maxlon); 203 map.addNode(4, maxlat, maxlon); 204 map.bounds.minlat = Math.toRadians(minlat); 205 map.bounds.maxlat = Math.toRadians(maxlat); 206 map.bounds.minlon = Math.toRadians(minlon); 207 map.bounds.maxlon = Math.toRadians(maxlon); 195 208 } 196 209 } 197 210 198 img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);211 /* img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB); 199 212 Renderer.reRender(img.createGraphics(), 12, 1, map, context); 200 213 ByteArrayOutputStream bos = new ByteArrayOutputStream(); … … 202 215 empty = bos.size(); 203 216 tile(zoom, 1, 0, 0); 204 205 for (int z = 12; z <= 18; z++) { 217 */ 218 // for (int z = 12; z <= 18; z++) { 219 int z = 9; 206 220 DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation(); 207 221 Document document = domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null); 208 222 SVGGraphics2D svgGenerator = new SVGGraphics2D(document); 209 svgGenerator.setSVGCanvasSize(new Dimension(256, 256)); 210 svgGenerator.setClip(0, 0, 256, 256); 211 svgGenerator.translate(-256, -256); 212 Renderer.reRender(svgGenerator, z, 1, map, context); 223 svgGenerator.setBackground(Rules.Bwater); 224 svgGenerator.clearRect(0, 0, 2048, 2048); 225 svgGenerator.setSVGCanvasSize(new Dimension(2048, 2048)); 226 svgGenerator.setClip(0, 0, 2048, 2048); 227 // svgGenerator.translate(-2048, -2048); 228 Renderer.reRender(svgGenerator, z, 0.05, map, context); 213 229 svgGenerator.stream(dstdir + "tst_" + z + ".svg"); 214 }230 // } 215 231 } 216 232 … … 281 297 send = new ArrayList<String>(); 282 298 deletes = new HashMap<String, Boolean>(); 283 BufferedReader in = new BufferedReader(new FileReader(srcdir + xtile + "-" + ytile + "-" + zoom+ ".osm"));299 BufferedReader in = new BufferedReader(new FileReader(srcdir + zoom + "-" + xtile + "-" + ytile + ".osm")); 284 300 String ln; 285 301 while ((ln = in.readLine()) != null) {
Note:
See TracChangeset
for help on using the changeset viewer.