Index: /applications/editors/josm/plugins/seachart/jbasemap/src/jbasemap/Jbasemap.java
===================================================================
--- /applications/editors/josm/plugins/seachart/jbasemap/src/jbasemap/Jbasemap.java	(revision 32905)
+++ /applications/editors/josm/plugins/seachart/jbasemap/src/jbasemap/Jbasemap.java	(revision 32906)
@@ -31,109 +31,109 @@
 public class Jbasemap {
 
-	static String src;
-	static String dst;
-	static Context context;
-	static S57map map;
-	static int zoom;
-	static double z2;
+    static String src;
+    static String dst;
+    static Context context;
+    static S57map map;
+    static int zoom;
+    static double z2;
 
-	static class Context implements ChartContext {
-		
-	  static double top = 0;
-	  static double mile = 0;
-	  
-	  public Context () {
-			top = (1.0 - Math.log(Math.tan(map.bounds.maxlat) + 1.0 / Math.cos(map.bounds.maxlat)) / Math.PI) / 2.0 * 256.0 * z2;
-			mile = 256 / ((Math.toDegrees(map.bounds.maxlat) - Math.toDegrees(map.bounds.minlat)) * 60);
-	  }
-	  
-		public Point2D getPoint(Snode coord) {
-			double x = (Math.toDegrees(coord.lon) - Math.toDegrees(map.bounds.minlon)) * 256.0 * (z2 / 2) / 180.0;
-			double y = ((1.0 - Math.log(Math.tan(coord.lat) + 1.0 / Math.cos(coord.lat)) / Math.PI) / 2.0 * 256.0 * z2) - top;
-			return new Point2D.Double(x, y);
-		}
+    static class Context implements ChartContext {
+        
+      static double top = 0;
+      static double mile = 0;
+      
+      public Context () {
+            top = (1.0 - Math.log(Math.tan(map.bounds.maxlat) + 1.0 / Math.cos(map.bounds.maxlat)) / Math.PI) / 2.0 * 256.0 * z2;
+            mile = 256 / ((Math.toDegrees(map.bounds.maxlat) - Math.toDegrees(map.bounds.minlat)) * 60);
+      }
+      
+        public Point2D getPoint(Snode coord) {
+            double x = (Math.toDegrees(coord.lon) - Math.toDegrees(map.bounds.minlon)) * 256.0 * (z2 / 2) / 180.0;
+            double y = ((1.0 - Math.log(Math.tan(coord.lat) + 1.0 / Math.cos(coord.lat)) / Math.PI) / 2.0 * 256.0 * z2) - top;
+            return new Point2D.Double(x, y);
+        }
 
-		public double mile(Feature feature) {
-			return mile;
-		}
+        public double mile(Feature feature) {
+            return mile;
+        }
 
-		public boolean clip() {
-			return true;
-		}
+        public boolean clip() {
+            return true;
+        }
 
-		public Color background(S57map map) {
-			if (map.features.containsKey(Obj.COALNE)) {
-				for (Feature feature : map.features.get(Obj.COALNE)) {
-					if (feature.geom.prim == Pflag.POINT) {
-						break;
-					}
-					GeomIterator git = map.new GeomIterator(feature.geom);
-					git.nextComp();
-					while (git.hasEdge()) {
-						git.nextEdge();
-						while (git.hasNode()) {
-							Snode node = git.next();
-							if (node == null)
-								continue;
-							if ((node.lat >= map.bounds.minlat) && (node.lat <= map.bounds.maxlat) && (node.lon >= map.bounds.minlon) && (node.lon <= map.bounds.maxlon)) {
-								return Symbols.Bwater;
-							}
-						}
-					}
-				}
-				return Symbols.Yland;
-			} else {
-				if (map.features.containsKey(Obj.ROADWY) || map.features.containsKey(Obj.RAILWY) || map.features.containsKey(Obj.LAKARE) || map.features.containsKey(Obj.RIVERS) || map.features.containsKey(Obj.CANALS)) {
-					return Symbols.Yland;
-				} else {
-					return Symbols.Bwater;
-				}
-			}
-		}
+        public Color background(S57map map) {
+            if (map.features.containsKey(Obj.COALNE)) {
+                for (Feature feature : map.features.get(Obj.COALNE)) {
+                    if (feature.geom.prim == Pflag.POINT) {
+                        break;
+                    }
+                    GeomIterator git = map.new GeomIterator(feature.geom);
+                    git.nextComp();
+                    while (git.hasEdge()) {
+                        git.nextEdge();
+                        while (git.hasNode()) {
+                            Snode node = git.next();
+                            if (node == null)
+                                continue;
+                            if ((node.lat >= map.bounds.minlat) && (node.lat <= map.bounds.maxlat) && (node.lon >= map.bounds.minlon) && (node.lon <= map.bounds.maxlon)) {
+                                return Symbols.Bwater;
+                            }
+                        }
+                    }
+                }
+                return Symbols.Yland;
+            } else {
+                if (map.features.containsKey(Obj.ROADWY) || map.features.containsKey(Obj.RAILWY) || map.features.containsKey(Obj.LAKARE) || map.features.containsKey(Obj.RIVERS) || map.features.containsKey(Obj.CANALS)) {
+                    return Symbols.Yland;
+                } else {
+                    return Symbols.Bwater;
+                }
+            }
+        }
 
-		public RuleSet ruleset() {
-			return RuleSet.BASE;
-		}
-	}
-	
-	public static void main(String[] args) throws IOException {
-		if (args.length < 5) {
-			System.err.println("Usage: java -jar jbasemap.jar OSM_file SVG_file zoom xtile ytile");
-			System.exit(-1);
-		}
-		src = args[0];
-		dst = args[1];
-		zoom = Integer.parseInt(args[2]);
-		z2 = Math.pow(2, zoom);
-		double scale = 0.1;
-		try {
-			BufferedReader in = new BufferedReader(new FileReader(src));
-			map = new S57map(false);
-			try {
-				S57osm.OSMmap(in, map, true);
-			} catch (Exception e) {
-				System.err.println("Input data error");
-				System.exit(-1);
-			}
-			in.close();
-		} catch (IOException e) {
-			System.err.println("Input file: " + e.getMessage());
-			System.exit(-1);
-		}
-		map.bounds.maxlat = Math.atan(Math.sinh(Math.PI * (1 - 2 * Double.parseDouble(args[4]) / z2)));
-		map.bounds.minlat = Math.atan(Math.sinh(Math.PI * (1 - 2 * (Double.parseDouble(args[4]) + 1) / z2)));
-		map.bounds.minlon = Math.toRadians(Double.parseDouble(args[3]) / z2 * 360.0 - 180.0);
-		map.bounds.maxlon = Math.toRadians((Double.parseDouble(args[3]) + 1) / z2 * 360.0 - 180.0);
-		context = new Context();
-		Rectangle rect = new Rectangle(256, 256);
-		DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
-		Document document = domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null);
-		SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
-		svgGenerator.clearRect(rect.x, rect.y, rect.width, rect.height);
-		svgGenerator.setSVGCanvasSize(rect.getSize());
-		svgGenerator.setClip(rect.x, rect.y, rect.width, rect.height);
-		Renderer.reRender(svgGenerator, rect, zoom, scale, map, context);
-		svgGenerator.stream(dst);
-		System.exit(0);
-	}
+        public RuleSet ruleset() {
+            return RuleSet.BASE;
+        }
+    }
+    
+    public static void main(String[] args) throws IOException {
+        if (args.length < 5) {
+            System.err.println("Usage: java -jar jbasemap.jar OSM_file SVG_file zoom xtile ytile");
+            System.exit(-1);
+        }
+        src = args[0];
+        dst = args[1];
+        zoom = Integer.parseInt(args[2]);
+        z2 = Math.pow(2, zoom);
+        double scale = 0.1;
+        try {
+            BufferedReader in = new BufferedReader(new FileReader(src));
+            map = new S57map(false);
+            try {
+                S57osm.OSMmap(in, map, true);
+            } catch (Exception e) {
+                System.err.println("Input data error");
+                System.exit(-1);
+            }
+            in.close();
+        } catch (IOException e) {
+            System.err.println("Input file: " + e.getMessage());
+            System.exit(-1);
+        }
+        map.bounds.maxlat = Math.atan(Math.sinh(Math.PI * (1 - 2 * Double.parseDouble(args[4]) / z2)));
+        map.bounds.minlat = Math.atan(Math.sinh(Math.PI * (1 - 2 * (Double.parseDouble(args[4]) + 1) / z2)));
+        map.bounds.minlon = Math.toRadians(Double.parseDouble(args[3]) / z2 * 360.0 - 180.0);
+        map.bounds.maxlon = Math.toRadians((Double.parseDouble(args[3]) + 1) / z2 * 360.0 - 180.0);
+        context = new Context();
+        Rectangle rect = new Rectangle(256, 256);
+        DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
+        Document document = domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null);
+        SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
+        svgGenerator.clearRect(rect.x, rect.y, rect.width, rect.height);
+        svgGenerator.setSVGCanvasSize(rect.getSize());
+        svgGenerator.setClip(rect.x, rect.y, rect.width, rect.height);
+        Renderer.reRender(svgGenerator, rect, zoom, scale, map, context);
+        svgGenerator.stream(dst);
+        System.exit(0);
+    }
 }
Index: /applications/editors/josm/plugins/seachart/jicons/src/jicons/Jicons.java
===================================================================
--- /applications/editors/josm/plugins/seachart/jicons/src/jicons/Jicons.java	(revision 32905)
+++ /applications/editors/josm/plugins/seachart/jicons/src/jicons/Jicons.java	(revision 32906)
@@ -37,177 +37,177 @@
 
 public class Jicons {
-	
-	static int x = 0;
-	static int y = 0;
-	static int w = 0;
-	static int h = 0;
-	static double s = 0;
-
-	public static void main(String[] args) throws IOException {
-		Context context;
-		S57map map = null;
-		BufferedReader in;
-		int line = 0;
-		String format = "";
-		String file = "";
-		String k = "";
-		String v = "";
-
-		BufferedImage img;
-		Graphics2D g2;
-		boolean inIcons = false;
-		boolean inIcon = false;
-		
-		if (args.length < 2) {
-			System.err.println("Usage: java -jar jicons.jar icon_definition_file icons_directory");
-			System.exit(-1);
-		}
-		in = new BufferedReader(new FileReader(args[0]));
-		
-		context = new Context();
-		String ln;
-		while ((ln = in.readLine()) != null) {
-			line++;
-			if (inIcons) {
-				if (inIcon) {
-					if (ln.contains("</icon")) {
-						inIcon = false;
-						map.tagsDone(0);
-						// generate icon file
-						switch (format) {
-						case "PNG":
-							img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
-							g2 = img.createGraphics();
-							Renderer.reRender(g2, new Rectangle(x, y, w, h), 16, s / Renderer.symbolScale[16], map, context);
-							try {
-								ImageIO.write(img, "png", new File(args[1] + file + ".png"));
-							} catch (Exception e) {
-								System.err.println("Line " + line + ": PNG write Exception");
-							}
-							System.err.println(file + ".png");
-							break;
-						case "SVG":
-							DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
-							String svgNS = "http://www.w3.org/2000/svg";
-							Document document = domImpl.createDocument(svgNS, "svg", null);
-							SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
-							svgGenerator.setSVGCanvasSize(new Dimension(w, h));
-							Renderer.reRender(svgGenerator, new Rectangle(x, y, w, h), 16, s / Renderer.symbolScale[16], map, context);
-							boolean useCSS = true;
-							Writer out = null;
-							try {
-								out = new OutputStreamWriter(new FileOutputStream(args[1] + file + ".svg"), "UTF-8");
-							} catch (IOException e1) {
-								System.err.println("Line " + line + ": SVG file Exception");
-							}
-							try {
-								svgGenerator.stream(out, useCSS);
-							} catch (SVGGraphics2DIOException e) {
-								System.err.println("Line " + line + ": SVG write Exception");
-							}
-							System.err.println(file + ".svg");
-							break;
-						}
-					} else if (ln.contains("<tag")) {
-						k = v = "";
-						String[] token = ln.split("k=");
-						k = token[1].split("[\"\']")[1];
-						token = token[1].split("v=");
-						v = token[1].split("[\"\']")[1];
-						if (k.isEmpty()) {
-							System.err.println("Line " + line + ": No key in tag");
-							System.exit(-1);
-						}
-						if (v.isEmpty()) {
-							System.err.println("Line " + line + ": No value in tag");
-							System.exit(-1);
-						}
-						map.addTag(k, v);
-					}
-				} else if (ln.contains("<icon")) {
-					inIcon = true;
-					h = w = x = y = -1;
-					s = 0;
-					file = format = "";
-					map = new S57map(true);
-					map.addNode(0, 0, 0);
-					for (String token : ln.split("[ ]+")) {
-						if (token.matches("^width=.+")) {
-							w = Integer.parseInt(token.split("[\"\']")[1]);
-						} else if (token.matches("^height=.+")) {
-							h = Integer.parseInt(token.split("[\"\']")[1]);
-						} else if (token.matches("^x=.+")) {
-							x = Integer.parseInt(token.split("[\"\']")[1]);
-						} else if (token.matches("^y=.+")) {
-							y = Integer.parseInt(token.split("[\"\']")[1]);
-						} else if (token.matches("^scale=.+")) {
-							s = Double.parseDouble(token.split("[\"\']")[1]);
-						} else if (token.matches("^file=.+")) {
-							file = (token.split("[\"\']")[1]);
-						} else if (token.matches("^format=.+")) {
-							format = (token.split("[\"\']")[1]);
-						}
-					}
-					if (file.isEmpty()) {
-						System.err.println("Line " + line + ": No filename");
-						System.exit(-1);
-					}
-					if (format.isEmpty()) {
-						System.err.println("Line " + line + ": No format");
-						System.exit(-1);
-					}
-					if ((h < 0) && (w < 0)) {
-						System.err.println("Line " + line + ": No icon size");
-						System.exit(-1);
-					}
-					if (w < 0) {
-						w = h;
-					}
-					if (h < 0) {
-						h = w;
-					}
-					if (x < 0) {
-						x = w / 2;
-					}
-					if (y < 0) {
-						y = h / 2;
-					}
-					if (s == 0) {
-						s = 1;
-					}
-				} else if (ln.contains("</icons")) {
-					inIcons = false;
-					break;
-				}
-			} else if (ln.contains("<icons")) {
-				inIcons = true;
-			}
-		}
-		in.close();
-		System.err.println("Finished");
-		System.exit(0);
-	}
-	
-	static class Context implements ChartContext {
-		
-		public Point2D getPoint(Snode coord) {
-			return new Point2D.Double(x, y);
-		}
-
-		public double mile(Feature feature) {
-			return Math.min(w, h);
-		}
-
-		public boolean clip() {
-			return false;
-		}
-
-		public Color background(S57map map) {
-			return new Color(0, true);
-		}
-
-		public RuleSet ruleset() {
-			return RuleSet.ALL;
-		}
-	}
+    
+    static int x = 0;
+    static int y = 0;
+    static int w = 0;
+    static int h = 0;
+    static double s = 0;
+
+    public static void main(String[] args) throws IOException {
+        Context context;
+        S57map map = null;
+        BufferedReader in;
+        int line = 0;
+        String format = "";
+        String file = "";
+        String k = "";
+        String v = "";
+
+        BufferedImage img;
+        Graphics2D g2;
+        boolean inIcons = false;
+        boolean inIcon = false;
+        
+        if (args.length < 2) {
+            System.err.println("Usage: java -jar jicons.jar icon_definition_file icons_directory");
+            System.exit(-1);
+        }
+        in = new BufferedReader(new FileReader(args[0]));
+        
+        context = new Context();
+        String ln;
+        while ((ln = in.readLine()) != null) {
+            line++;
+            if (inIcons) {
+                if (inIcon) {
+                    if (ln.contains("</icon")) {
+                        inIcon = false;
+                        map.tagsDone(0);
+                        // generate icon file
+                        switch (format) {
+                        case "PNG":
+                            img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+                            g2 = img.createGraphics();
+                            Renderer.reRender(g2, new Rectangle(x, y, w, h), 16, s / Renderer.symbolScale[16], map, context);
+                            try {
+                                ImageIO.write(img, "png", new File(args[1] + file + ".png"));
+                            } catch (Exception e) {
+                                System.err.println("Line " + line + ": PNG write Exception");
+                            }
+                            System.err.println(file + ".png");
+                            break;
+                        case "SVG":
+                            DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
+                            String svgNS = "http://www.w3.org/2000/svg";
+                            Document document = domImpl.createDocument(svgNS, "svg", null);
+                            SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
+                            svgGenerator.setSVGCanvasSize(new Dimension(w, h));
+                            Renderer.reRender(svgGenerator, new Rectangle(x, y, w, h), 16, s / Renderer.symbolScale[16], map, context);
+                            boolean useCSS = true;
+                            Writer out = null;
+                            try {
+                                out = new OutputStreamWriter(new FileOutputStream(args[1] + file + ".svg"), "UTF-8");
+                            } catch (IOException e1) {
+                                System.err.println("Line " + line + ": SVG file Exception");
+                            }
+                            try {
+                                svgGenerator.stream(out, useCSS);
+                            } catch (SVGGraphics2DIOException e) {
+                                System.err.println("Line " + line + ": SVG write Exception");
+                            }
+                            System.err.println(file + ".svg");
+                            break;
+                        }
+                    } else if (ln.contains("<tag")) {
+                        k = v = "";
+                        String[] token = ln.split("k=");
+                        k = token[1].split("[\"\']")[1];
+                        token = token[1].split("v=");
+                        v = token[1].split("[\"\']")[1];
+                        if (k.isEmpty()) {
+                            System.err.println("Line " + line + ": No key in tag");
+                            System.exit(-1);
+                        }
+                        if (v.isEmpty()) {
+                            System.err.println("Line " + line + ": No value in tag");
+                            System.exit(-1);
+                        }
+                        map.addTag(k, v);
+                    }
+                } else if (ln.contains("<icon")) {
+                    inIcon = true;
+                    h = w = x = y = -1;
+                    s = 0;
+                    file = format = "";
+                    map = new S57map(true);
+                    map.addNode(0, 0, 0);
+                    for (String token : ln.split("[ ]+")) {
+                        if (token.matches("^width=.+")) {
+                            w = Integer.parseInt(token.split("[\"\']")[1]);
+                        } else if (token.matches("^height=.+")) {
+                            h = Integer.parseInt(token.split("[\"\']")[1]);
+                        } else if (token.matches("^x=.+")) {
+                            x = Integer.parseInt(token.split("[\"\']")[1]);
+                        } else if (token.matches("^y=.+")) {
+                            y = Integer.parseInt(token.split("[\"\']")[1]);
+                        } else if (token.matches("^scale=.+")) {
+                            s = Double.parseDouble(token.split("[\"\']")[1]);
+                        } else if (token.matches("^file=.+")) {
+                            file = (token.split("[\"\']")[1]);
+                        } else if (token.matches("^format=.+")) {
+                            format = (token.split("[\"\']")[1]);
+                        }
+                    }
+                    if (file.isEmpty()) {
+                        System.err.println("Line " + line + ": No filename");
+                        System.exit(-1);
+                    }
+                    if (format.isEmpty()) {
+                        System.err.println("Line " + line + ": No format");
+                        System.exit(-1);
+                    }
+                    if ((h < 0) && (w < 0)) {
+                        System.err.println("Line " + line + ": No icon size");
+                        System.exit(-1);
+                    }
+                    if (w < 0) {
+                        w = h;
+                    }
+                    if (h < 0) {
+                        h = w;
+                    }
+                    if (x < 0) {
+                        x = w / 2;
+                    }
+                    if (y < 0) {
+                        y = h / 2;
+                    }
+                    if (s == 0) {
+                        s = 1;
+                    }
+                } else if (ln.contains("</icons")) {
+                    inIcons = false;
+                    break;
+                }
+            } else if (ln.contains("<icons")) {
+                inIcons = true;
+            }
+        }
+        in.close();
+        System.err.println("Finished");
+        System.exit(0);
+    }
+    
+    static class Context implements ChartContext {
+        
+        public Point2D getPoint(Snode coord) {
+            return new Point2D.Double(x, y);
+        }
+
+        public double mile(Feature feature) {
+            return Math.min(w, h);
+        }
+
+        public boolean clip() {
+            return false;
+        }
+
+        public Color background(S57map map) {
+            return new Color(0, true);
+        }
+
+        public RuleSet ruleset() {
+            return RuleSet.ALL;
+        }
+    }
 }
Index: /applications/editors/josm/plugins/seachart/josmtos57/src/josmtos57/Josmtos57.java
===================================================================
--- /applications/editors/josm/plugins/seachart/josmtos57/src/josmtos57/Josmtos57.java	(revision 32905)
+++ /applications/editors/josm/plugins/seachart/josmtos57/src/josmtos57/Josmtos57.java	(revision 32906)
@@ -22,133 +22,133 @@
 public class Josmtos57 {
 
-	// http://opendatacommons.org/licenses/odbl/1-0/
-	
-	/*
-	URL website = new URL("http://www.website.com/information.asp");
-	try (InputStream in = website.openStream()) { Files.copy(in, target, StandardCopyOption.REPLACE_EXISTING); }
-	 */
-	
-	/*
-	 * To do:
-	 * 1. Geometry truncation at cell boundary.
-	 * 2. Geometry validation/correction to comply with S57 limitations.
-	 * 3. Improvements in mapping of OSM features to S57 objects.
-	 */
+    // http://opendatacommons.org/licenses/odbl/1-0/
+    
+    /*
+    URL website = new URL("http://www.website.com/information.asp");
+    try (InputStream in = website.openStream()) { Files.copy(in, target, StandardCopyOption.REPLACE_EXISTING); }
+     */
+    
+    /*
+     * To do:
+     * 1. Geometry truncation at cell boundary.
+     * 2. Geometry validation/correction to comply with S57 limitations.
+     * 3. Improvements in mapping of OSM features to S57 objects.
+     */
 
-	static byte[] header = {
-		'0', '0', '2', '6', '2', '3', 'L', 'E', '1', ' ', '0', '9', '0', '0', '0', '7', '3', ' ', ' ', ' ', '6', '6', '0', '4', '0', '0', '0', '0', '0', '0', '0', '0',
-		'1', '9', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '4', '8', '0', '0', '0', '0', '1', '9', 'C', 'A', 'T', 'D', '0', '0', '0', '1',
-		'2', '2', '0', '0', '0', '0', '6', '7', 0x1e, '0', '0', '0', '0', ';', '&', ' ', ' ', ' ', 0x1f, '0', '0', '0', '1', 'C', 'A', 'T', 'D', 0x1e, '0', '1', '0', '0',
-		';', '&', ' ', ' ', ' ', 'I', 'S', 'O', '/', 'I', 'E', 'C', ' ', '8', '2', '1', '1', ' ', 'R', 'e', 'c', 'o', 'r', 'd', ' ', 'I', 'd', 'e', 'n', 't', 'i', 'f',
-		'i', 'e', 'r', 0x1f, 0x1f, '(', 'I', '(', '5', ')', ')', 0x1e, '1', '6', '0', '0', ';', '&', ' ', ' ', ' ', 'C', 'a', 't', 'a', 'l', 'o', 'g', 'u', 'e', ' ', 'D',
-		'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', ' ', 'F', 'i', 'e', 'l', 'd', 0x1f, 'R', 'C', 'N', 'M', '!', 'R', 'C', 'I', 'D', '!', 'F', 'I', 'L', 'E', '!', 'L', 'F',
-		'I', 'L', '!', 'V', 'O', 'L', 'M', '!', 'I', 'M', 'P', 'L', '!', 'S', 'L', 'A', 'T', '!', 'W', 'L', 'O', 'N', '!', 'N', 'L', 'A', 'T', '!', 'E', 'L', 'O', 'N',
-		'!', 'C', 'R', 'C', 'S', '!', 'C', 'O', 'M', 'T', 0x1f, '(', 'A', '(', '2', ')', ',', 'I', '(', '1', '0', ')', ',', '3', 'A', ',', 'A', '(', '3', ')', ',', '4',
-		'R', ',', '2', 'A', ')', 0x1e, 
-		'0', '0', '1', '0', '1', ' ', 'D', ' ', ' ', ' ', ' ', ' ', '0', '0', '0', '5', '3', ' ', ' ', ' ', '5', '5', '0', '4',
-		'0', '0', '0', '1', '0', '0', '0', '0', '6', '0', '0', '0', '0', '0',   'C', 'A', 'T', 'D', '0', '0', '0', '4', '2', '0', '0', '0', '0', '6', 0x1e,
-		'0', '0', '0', '0', '0', 0x1e, 'C', 'D', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'C', 'A', 'T', 'A', 'L', 'O', 'G', '.', '0', '3', '1', 0x1f,
-		0x1f, 'V', '0', '1', 'X', '0', '1', 0x1f, 'A', 'S', 'C', 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1e
-	};
-	
-	static BufferedReader in;
-	static FileOutputStream out;
-	static S57map map;
-	static byte[] buf;
-	static HashMap<String, String> meta;
-	static ArrayList<Fparams> fields;
-	static byte[] record;
-	
-	public static void main(String[] args) throws IOException {
+    static byte[] header = {
+        '0', '0', '2', '6', '2', '3', 'L', 'E', '1', ' ', '0', '9', '0', '0', '0', '7', '3', ' ', ' ', ' ', '6', '6', '0', '4', '0', '0', '0', '0', '0', '0', '0', '0',
+        '1', '9', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '4', '8', '0', '0', '0', '0', '1', '9', 'C', 'A', 'T', 'D', '0', '0', '0', '1',
+        '2', '2', '0', '0', '0', '0', '6', '7', 0x1e, '0', '0', '0', '0', ';', '&', ' ', ' ', ' ', 0x1f, '0', '0', '0', '1', 'C', 'A', 'T', 'D', 0x1e, '0', '1', '0', '0',
+        ';', '&', ' ', ' ', ' ', 'I', 'S', 'O', '/', 'I', 'E', 'C', ' ', '8', '2', '1', '1', ' ', 'R', 'e', 'c', 'o', 'r', 'd', ' ', 'I', 'd', 'e', 'n', 't', 'i', 'f',
+        'i', 'e', 'r', 0x1f, 0x1f, '(', 'I', '(', '5', ')', ')', 0x1e, '1', '6', '0', '0', ';', '&', ' ', ' ', ' ', 'C', 'a', 't', 'a', 'l', 'o', 'g', 'u', 'e', ' ', 'D',
+        'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', ' ', 'F', 'i', 'e', 'l', 'd', 0x1f, 'R', 'C', 'N', 'M', '!', 'R', 'C', 'I', 'D', '!', 'F', 'I', 'L', 'E', '!', 'L', 'F',
+        'I', 'L', '!', 'V', 'O', 'L', 'M', '!', 'I', 'M', 'P', 'L', '!', 'S', 'L', 'A', 'T', '!', 'W', 'L', 'O', 'N', '!', 'N', 'L', 'A', 'T', '!', 'E', 'L', 'O', 'N',
+        '!', 'C', 'R', 'C', 'S', '!', 'C', 'O', 'M', 'T', 0x1f, '(', 'A', '(', '2', ')', ',', 'I', '(', '1', '0', ')', ',', '3', 'A', ',', 'A', '(', '3', ')', ',', '4',
+        'R', ',', '2', 'A', ')', 0x1e, 
+        '0', '0', '1', '0', '1', ' ', 'D', ' ', ' ', ' ', ' ', ' ', '0', '0', '0', '5', '3', ' ', ' ', ' ', '5', '5', '0', '4',
+        '0', '0', '0', '1', '0', '0', '0', '0', '6', '0', '0', '0', '0', '0',   'C', 'A', 'T', 'D', '0', '0', '0', '4', '2', '0', '0', '0', '0', '6', 0x1e,
+        '0', '0', '0', '0', '0', 0x1e, 'C', 'D', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'C', 'A', 'T', 'A', 'L', 'O', 'G', '.', '0', '3', '1', 0x1f,
+        0x1f, 'V', '0', '1', 'X', '0', '1', 0x1f, 'A', 'S', 'C', 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1e
+    };
+    
+    static BufferedReader in;
+    static FileOutputStream out;
+    static S57map map;
+    static byte[] buf;
+    static HashMap<String, String> meta;
+    static ArrayList<Fparams> fields;
+    static byte[] record;
+    
+    public static void main(String[] args) throws IOException {
 
-		map = new S57map(false);
-		int idx = 0;
-		
-		if (args.length < 4) {
-			System.err.println("Usage: java -jar josmtos57.jar OSM_filename meta_data_filename S57_ENC_ROOT_directory S57_filename");
-			System.exit(-1);
-		}
-		try {
-			Scanner min = new Scanner(new FileInputStream(args[1]));
-			meta = new HashMap<>();
-			meta.put("FILE", args[3]);
-			while (min.hasNext()) {
-				String[] tokens = min.next().split("=");
-				if (tokens.length >= 2)
-					meta.put(tokens[0], tokens[1].split("[ #]")[0]);
-			}
-			min.close();
-		} catch (IOException e) {
-			System.err.println("Meta data file: " + e.getMessage());
-			System.exit(-1);
-		}
-		try {
-			in = new BufferedReader(new FileReader(new File(args[0])));
-			try {
-				S57osm.OSMmap(in, map, false);
-			} catch (Exception e) {
-				System.err.println("Input data error");
-				System.exit(-1);
-			}
-			in.close();
-		} catch (IOException e) {
-			System.err.println("Input file: " + e.getMessage());
-			System.exit(-1);
-		}
-		
-		try {
-			buf = new byte[5242880];
-			idx = S57enc.encodeChart(map, meta, buf);
-		} catch (IndexOutOfBoundsException e) {
-			System.err.println("Output file too big (limit 5 MB) - try smaller areas");
-			System.exit(-1);
-		} catch (UnsupportedEncodingException e) {
-			System.err.println("Input data error" + e.getMessage());
-			System.exit(-1);
-		}
-		
-		CRC32 crc = new CRC32();
-		crc.update(buf, 0, idx);
-		try {
-			File file = new File(args[2] + args[3]);
-			if (file.exists()) file.delete();
-			out = new FileOutputStream(file, false);
-			out.write(buf, 0, idx);
-		} catch (IOException e) {
-			System.err.println("Output file: " + e.getMessage());
-			System.exit(-1);
-		}
-		out.close();
-		
-		buf = new byte[header.length];
-		System.arraycopy(header, 0, buf, 0, header.length);
-		idx = header.length;
-		int recs = 2;
-		fields = new ArrayList<>();
-		fields.add(new Fparams(S57field.CATD, new Object[]{ "CD", recs, args[3], "", "V01X01", "BIN", Math.toDegrees(map.bounds.minlat),
-				Math.toDegrees(map.bounds.minlon), Math.toDegrees(map.bounds.maxlat), Math.toDegrees(map.bounds.maxlon), String.format("%08X", crc.getValue()), "" }));
-		record = S57dat.encRecord(String.valueOf(recs++), fields);
-		buf = Arrays.copyOf(buf, (buf.length + record.length));
-		System.arraycopy(record, 0, buf, idx, record.length);
-		idx += record.length;
+        map = new S57map(false);
+        int idx = 0;
+        
+        if (args.length < 4) {
+            System.err.println("Usage: java -jar josmtos57.jar OSM_filename meta_data_filename S57_ENC_ROOT_directory S57_filename");
+            System.exit(-1);
+        }
+        try {
+            Scanner min = new Scanner(new FileInputStream(args[1]));
+            meta = new HashMap<>();
+            meta.put("FILE", args[3]);
+            while (min.hasNext()) {
+                String[] tokens = min.next().split("=");
+                if (tokens.length >= 2)
+                    meta.put(tokens[0], tokens[1].split("[ #]")[0]);
+            }
+            min.close();
+        } catch (IOException e) {
+            System.err.println("Meta data file: " + e.getMessage());
+            System.exit(-1);
+        }
+        try {
+            in = new BufferedReader(new FileReader(new File(args[0])));
+            try {
+                S57osm.OSMmap(in, map, false);
+            } catch (Exception e) {
+                System.err.println("Input data error");
+                System.exit(-1);
+            }
+            in.close();
+        } catch (IOException e) {
+            System.err.println("Input file: " + e.getMessage());
+            System.exit(-1);
+        }
+        
+        try {
+            buf = new byte[5242880];
+            idx = S57enc.encodeChart(map, meta, buf);
+        } catch (IndexOutOfBoundsException e) {
+            System.err.println("Output file too big (limit 5 MB) - try smaller areas");
+            System.exit(-1);
+        } catch (UnsupportedEncodingException e) {
+            System.err.println("Input data error" + e.getMessage());
+            System.exit(-1);
+        }
+        
+        CRC32 crc = new CRC32();
+        crc.update(buf, 0, idx);
+        try {
+            File file = new File(args[2] + args[3]);
+            if (file.exists()) file.delete();
+            out = new FileOutputStream(file, false);
+            out.write(buf, 0, idx);
+        } catch (IOException e) {
+            System.err.println("Output file: " + e.getMessage());
+            System.exit(-1);
+        }
+        out.close();
+        
+        buf = new byte[header.length];
+        System.arraycopy(header, 0, buf, 0, header.length);
+        idx = header.length;
+        int recs = 2;
+        fields = new ArrayList<>();
+        fields.add(new Fparams(S57field.CATD, new Object[]{ "CD", recs, args[3], "", "V01X01", "BIN", Math.toDegrees(map.bounds.minlat),
+                Math.toDegrees(map.bounds.minlon), Math.toDegrees(map.bounds.maxlat), Math.toDegrees(map.bounds.maxlon), String.format("%08X", crc.getValue()), "" }));
+        record = S57dat.encRecord(String.valueOf(recs++), fields);
+        buf = Arrays.copyOf(buf, (buf.length + record.length));
+        System.arraycopy(record, 0, buf, idx, record.length);
+        idx += record.length;
 
-		try {
-			File file = new File(args[2] + "CATALOG.031");
-			if (file.exists()) file.delete();
-			out = new FileOutputStream(file, false);
-			out.write(buf, 0, idx);
-		} catch (IOException e) {
-			System.err.println("Catalogue file: " + e.getMessage());
-			System.exit(-1);
-		}
-		out.close();
+        try {
+            File file = new File(args[2] + "CATALOG.031");
+            if (file.exists()) file.delete();
+            out = new FileOutputStream(file, false);
+            out.write(buf, 0, idx);
+        } catch (IOException e) {
+            System.err.println("Catalogue file: " + e.getMessage());
+            System.exit(-1);
+        }
+        out.close();
 
-//		String[] dir = (new File(args[2]).list());
-//		for (String item : dir) {
-//			System.err.println(item);
-//		}
-		
-		System.err.println("Finished");
-	}
+//        String[] dir = (new File(args[2]).list());
+//        for (String item : dir) {
+//            System.err.println(item);
+//        }
+        
+        System.err.println("Finished");
+    }
 
 }
Index: /applications/editors/josm/plugins/seachart/jplotter/src/jplotter/Jplotter.java
===================================================================
--- /applications/editors/josm/plugins/seachart/jplotter/src/jplotter/Jplotter.java	(revision 32905)
+++ /applications/editors/josm/plugins/seachart/jplotter/src/jplotter/Jplotter.java	(revision 32906)
@@ -6,20 +6,20 @@
 public class Jplotter {
 
-	public static void main(String[] args) {
-		JFrame frame = new JFrame("Chart Plotter");
-		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-		frame.setLayout(null);
-		Container c = frame.getContentPane();
+    public static void main(String[] args) {
+        JFrame frame = new JFrame("Chart Plotter");
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setLayout(null);
+        Container c = frame.getContentPane();
 
-		JPanel map = new JPanel(new BorderLayout());
-		map.setSize(600, 600);
-		map.setLocation(50, 35);
-		map.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), BorderFactory.createLoweredBevelBorder()));
-		map.setLayout(null);
-		map.setVisible(true);
-		c.add(map);
+        JPanel map = new JPanel(new BorderLayout());
+        map.setSize(600, 600);
+        map.setLocation(50, 35);
+        map.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), BorderFactory.createLoweredBevelBorder()));
+        map.setLayout(null);
+        map.setVisible(true);
+        c.add(map);
 
-		frame.setSize(700, 700);
-		frame.setVisible(true);
-	}
+        frame.setSize(700, 700);
+        frame.setVisible(true);
+    }
 }
Index: /applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java
===================================================================
--- /applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java	(revision 32905)
+++ /applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java	(revision 32906)
@@ -34,145 +34,145 @@
 public class Jrender {
 
-	static String srcdir;
-	static String dstdir;
-	static int xtile;
-	static int ytile;
-	static int zoom;
-	static ArrayList<String> send;
-	static HashMap<String, Boolean> deletes;
-	static Context context;
-	static S57map map;
-	static int empty;
+    static String srcdir;
+    static String dstdir;
+    static int xtile;
+    static int ytile;
+    static int zoom;
+    static ArrayList<String> send;
+    static HashMap<String, Boolean> deletes;
+    static Context context;
+    static S57map map;
+    static int empty;
 
-	static class Context implements ChartContext {
-		
-	  static double top;
-	  static double mile;
-	  
-	  public Context () {
-			top = (1.0 - Math.log(Math.tan(map.bounds.maxlat) + 1.0 / Math.cos(map.bounds.maxlat)) / Math.PI) / 2.0 * 256.0 * 4096.0 * Math.pow(2, (zoom - 12));
-			mile = (2 * ((zoom < 12) ? (256 / (int)(Math.pow(2, (11 - zoom)))) : 256) + 256) / ((Math.toDegrees(map.bounds.maxlat) - Math.toDegrees(map.bounds.minlat)) * 60);
-	  }
-	  
-		public Point2D getPoint(Snode coord) {
-			double x = (Math.toDegrees(coord.lon) - Math.toDegrees(map.bounds.minlon)) * 256.0 * 2048.0 * Math.pow(2, (zoom - 12)) / 180.0;
-			double y = ((1.0 - Math.log(Math.tan(coord.lat) + 1.0 / Math.cos(coord.lat)) / Math.PI) / 2.0 * 256.0 * 4096.0 * Math.pow(2, (zoom - 12))) - top;
-			return new Point2D.Double(x, y);
-		}
+    static class Context implements ChartContext {
+        
+      static double top;
+      static double mile;
+      
+      public Context () {
+            top = (1.0 - Math.log(Math.tan(map.bounds.maxlat) + 1.0 / Math.cos(map.bounds.maxlat)) / Math.PI) / 2.0 * 256.0 * 4096.0 * Math.pow(2, (zoom - 12));
+            mile = (2 * ((zoom < 12) ? (256 / (int)(Math.pow(2, (11 - zoom)))) : 256) + 256) / ((Math.toDegrees(map.bounds.maxlat) - Math.toDegrees(map.bounds.minlat)) * 60);
+      }
+      
+        public Point2D getPoint(Snode coord) {
+            double x = (Math.toDegrees(coord.lon) - Math.toDegrees(map.bounds.minlon)) * 256.0 * 2048.0 * Math.pow(2, (zoom - 12)) / 180.0;
+            double y = ((1.0 - Math.log(Math.tan(coord.lat) + 1.0 / Math.cos(coord.lat)) / Math.PI) / 2.0 * 256.0 * 4096.0 * Math.pow(2, (zoom - 12))) - top;
+            return new Point2D.Double(x, y);
+        }
 
-		public double mile(Feature feature) {
-			return mile;
-		}
+        public double mile(Feature feature) {
+            return mile;
+        }
 
-		public boolean clip() {
-			return false;
-		}
+        public boolean clip() {
+            return false;
+        }
 
-		public Color background(S57map map) {
-			return new Color(0, true);
-		}
+        public Color background(S57map map) {
+            return new Color(0, true);
+        }
 
-		public RuleSet ruleset() {
-			return RuleSet.SEAMARK;
-		}
-	}
-	
-	static void tile(int z, int s, int xn, int yn) throws IOException {
-		int border = (z < 12) ? (256 / (int)(Math.pow(2, (11 - zoom)))) : 256;
-		int scale = (int)Math.pow(2, z - 12);
-		int xdir = (scale > 0) ? (scale * xtile) + xn : xtile;
-		int ynam = (scale > 0) ? (scale * ytile) + yn : ytile;
-		BufferedImage img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
-		Graphics2D g2 = img.createGraphics();
-		g2.scale(s, s);
-		g2.translate(-(border + (xn * 256 / s)), -(border + (yn * 256 / s)));
-		Renderer.reRender(g2, new Rectangle(256, 256), z, 1.0 * Math.pow(2, (zoom - 12)), map, context);
-		ByteArrayOutputStream bos = new ByteArrayOutputStream();
-		ImageIO.write(img, "png", bos);
-		if (bos.size() > empty) {
-			String dstnam = dstdir + z + "/" + xdir + "/" + ynam + ".png";
-			deletes.remove(dstnam);
-			send.add("put " + dstnam + " tiles/" + z + "/" + xdir + "/" + ynam + ".png");
-			File ofile = new File(dstdir + "/" + z + "/" + xdir + "/");
-			ofile.mkdirs();
-			FileOutputStream fos = new FileOutputStream(dstdir + "/" + z + "/" + xdir + "/" + ynam + ".png");
-			bos.writeTo(fos);
-			fos.close();
-			if (send.size() > 20) {
-				PrintWriter writer = new PrintWriter(srcdir + z + "-" + xdir + "-" + ynam + ".send", "UTF-8");
-				for (String str : send) {
-					writer.println(str);
-				}
-				writer.close();
-				send = new ArrayList<>();
-			}
-		}
-		if ((z >= 12) && (z < 18) && ((z < 16) || (bos.size() > empty))) {
-			for (int x = 0; x < 2; x++) {
-				for (int y = 0; y < 2; y++) {
-					tile((z + 1), (s * 2), (xn * 2 + x), (yn * 2 + y));
-				}
-			}
-		}
-	}
-	
-	static void clean(int z, int xn, int yn) throws Exception {
-		int scale = (int) Math.pow(2, z - 12);
-		int xdir = (scale * xtile) + xn;
-		int ynam = (scale * ytile) + yn;
-		String delnam = dstdir + z + "/" + xdir + "/" + ynam + ".png";
-		File delfile = new File(delnam);
-		if (delfile.exists()) {
-			deletes.put(delnam, true);
-			delfile.delete();
-		}
-		if ((z < 18)) {
-			for (int x = 0; x < 2; x++) {
-				for (int y = 0; y < 2; y++) {
-					clean((z + 1), (xn * 2 + x), (yn * 2 + y));
-				}
-			}
-		}
-	}
-	
-	public static void main(String[] args) throws Exception {
-		if (args.length < 5) {
-			System.err.println("Usage: java -jar jrender.jar <osm source directory> <tile directory> <zoom> <xtile> <ytile>");
-			System.exit(-1);
-		}
-		srcdir = args[0];
-		dstdir = args[1];
-		zoom = Integer.parseInt(args[2]);
-		xtile = Integer.parseInt(args[3]);
-		ytile = Integer.parseInt(args[4]);
-		send = new ArrayList<>();
-		deletes = new HashMap<>();
-		BufferedReader in = new BufferedReader(new FileReader(srcdir + xtile + "-" + ytile + "-" + zoom + ".osm"));
-		map = new S57map(true);
-		S57osm.OSMmap(in, map, false);
-		in.close();
-		context = new Context();
-		ByteArrayOutputStream bos = new ByteArrayOutputStream();
-		ImageIO.write(new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB), "png", bos);
-		empty = bos.size();
-		if (zoom == 12) {
-			clean(12, 0, 0);
-		}
-		tile(zoom, 1, 0, 0);
-		if (send.size() > 0) {
-			PrintWriter writer = new PrintWriter(srcdir + zoom + "-" + xtile + "-" + ytile + ".send", "UTF-8");
-			for (String str : send) {
-				writer.println(str);
-			}
-			writer.close();
-		}
-		if (deletes.size() > 0) {
-			PrintWriter writer = new PrintWriter(srcdir + zoom + "-" + xtile + "-" + ytile + ".delete", "UTF-8");
-			for (String del : deletes.keySet()) {
-				writer.println("rm " + del);
-			}
-			writer.close();
-		}
-		System.exit(0);
-	}
+        public RuleSet ruleset() {
+            return RuleSet.SEAMARK;
+        }
+    }
+    
+    static void tile(int z, int s, int xn, int yn) throws IOException {
+        int border = (z < 12) ? (256 / (int)(Math.pow(2, (11 - zoom)))) : 256;
+        int scale = (int)Math.pow(2, z - 12);
+        int xdir = (scale > 0) ? (scale * xtile) + xn : xtile;
+        int ynam = (scale > 0) ? (scale * ytile) + yn : ytile;
+        BufferedImage img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2 = img.createGraphics();
+        g2.scale(s, s);
+        g2.translate(-(border + (xn * 256 / s)), -(border + (yn * 256 / s)));
+        Renderer.reRender(g2, new Rectangle(256, 256), z, 1.0 * Math.pow(2, (zoom - 12)), map, context);
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        ImageIO.write(img, "png", bos);
+        if (bos.size() > empty) {
+            String dstnam = dstdir + z + "/" + xdir + "/" + ynam + ".png";
+            deletes.remove(dstnam);
+            send.add("put " + dstnam + " tiles/" + z + "/" + xdir + "/" + ynam + ".png");
+            File ofile = new File(dstdir + "/" + z + "/" + xdir + "/");
+            ofile.mkdirs();
+            FileOutputStream fos = new FileOutputStream(dstdir + "/" + z + "/" + xdir + "/" + ynam + ".png");
+            bos.writeTo(fos);
+            fos.close();
+            if (send.size() > 20) {
+                PrintWriter writer = new PrintWriter(srcdir + z + "-" + xdir + "-" + ynam + ".send", "UTF-8");
+                for (String str : send) {
+                    writer.println(str);
+                }
+                writer.close();
+                send = new ArrayList<>();
+            }
+        }
+        if ((z >= 12) && (z < 18) && ((z < 16) || (bos.size() > empty))) {
+            for (int x = 0; x < 2; x++) {
+                for (int y = 0; y < 2; y++) {
+                    tile((z + 1), (s * 2), (xn * 2 + x), (yn * 2 + y));
+                }
+            }
+        }
+    }
+    
+    static void clean(int z, int xn, int yn) throws Exception {
+        int scale = (int) Math.pow(2, z - 12);
+        int xdir = (scale * xtile) + xn;
+        int ynam = (scale * ytile) + yn;
+        String delnam = dstdir + z + "/" + xdir + "/" + ynam + ".png";
+        File delfile = new File(delnam);
+        if (delfile.exists()) {
+            deletes.put(delnam, true);
+            delfile.delete();
+        }
+        if ((z < 18)) {
+            for (int x = 0; x < 2; x++) {
+                for (int y = 0; y < 2; y++) {
+                    clean((z + 1), (xn * 2 + x), (yn * 2 + y));
+                }
+            }
+        }
+    }
+    
+    public static void main(String[] args) throws Exception {
+        if (args.length < 5) {
+            System.err.println("Usage: java -jar jrender.jar <osm source directory> <tile directory> <zoom> <xtile> <ytile>");
+            System.exit(-1);
+        }
+        srcdir = args[0];
+        dstdir = args[1];
+        zoom = Integer.parseInt(args[2]);
+        xtile = Integer.parseInt(args[3]);
+        ytile = Integer.parseInt(args[4]);
+        send = new ArrayList<>();
+        deletes = new HashMap<>();
+        BufferedReader in = new BufferedReader(new FileReader(srcdir + xtile + "-" + ytile + "-" + zoom + ".osm"));
+        map = new S57map(true);
+        S57osm.OSMmap(in, map, false);
+        in.close();
+        context = new Context();
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        ImageIO.write(new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB), "png", bos);
+        empty = bos.size();
+        if (zoom == 12) {
+            clean(12, 0, 0);
+        }
+        tile(zoom, 1, 0, 0);
+        if (send.size() > 0) {
+            PrintWriter writer = new PrintWriter(srcdir + zoom + "-" + xtile + "-" + ytile + ".send", "UTF-8");
+            for (String str : send) {
+                writer.println(str);
+            }
+            writer.close();
+        }
+        if (deletes.size() > 0) {
+            PrintWriter writer = new PrintWriter(srcdir + zoom + "-" + xtile + "-" + ytile + ".delete", "UTF-8");
+            for (String del : deletes.keySet()) {
+                writer.println("rm " + del);
+            }
+            writer.close();
+        }
+        System.exit(0);
+    }
 }
Index: /applications/editors/josm/plugins/seachart/js57toosm/src/js57toosm/Js57toosm.java
===================================================================
--- /applications/editors/josm/plugins/seachart/js57toosm/src/js57toosm/Js57toosm.java	(revision 32905)
+++ /applications/editors/josm/plugins/seachart/js57toosm/src/js57toosm/Js57toosm.java	(revision 32906)
@@ -26,203 +26,203 @@
 
 public class Js57toosm {
-	
-	static FileInputStream in;
-	static PrintStream out;
-	static S57map map;
-	static final ArrayList<Att> typatts = new ArrayList<>(); static {
-		typatts.add(Att.OBJNAM); typatts.add(Att.NOBJNM); typatts.add(Att.STATUS); typatts.add(Att.INFORM); typatts.add(Att.NINFOM);
-		typatts.add(Att.PEREND); typatts.add(Att.PERSTA); typatts.add(Att.CONDTN); typatts.add(Att.CONRAD); typatts.add(Att.CONVIS);
-	}
-	
-	public static void main(String[] args) throws IOException {
-
-		ArrayList<Long> done = new ArrayList<>();
-
-		if (args.length < 3) {
-			System.err.println("Usage: java -jar js57toosm.jar S57_filename types_filename OSM_filename");
-			System.exit(-1);
-		}
-		try {
-			in = new FileInputStream(args[0]);
-		} catch (IOException e) {
-			System.err.println("Input file: " + e.getMessage());
-			System.exit(-1);
-		}
-		try {
-			out = new PrintStream(args[2]);
-		} catch (IOException e) {
-			System.err.println("Output file: " + e.getMessage());
-			in.close();
-			System.exit(-1);
-		}
-		ArrayList<Obj> types = new ArrayList<>();
-		try {
-			Scanner tin = new Scanner(new FileInputStream(args[1]));
-			while (tin.hasNext()) {
-				Obj type = S57obj.enumType(tin.next());
-				if (type != Obj.UNKOBJ)
-					types.add(type);
-			}
-			tin.close();
-		} catch (IOException e) {
-			System.err.println("Types file: " + e.getMessage());
-			in.close();
-			out.close();
-			System.exit(-1);
-		}
-		
-		map = new S57map(true);
-		S57dec.decodeChart(in, map);
-
-		out.format("<?xml version='1.0' encoding='UTF-8'?>%n");
-		out.format("<osm version='0.6' upload='false' generator='js57toosm'>%n");
-		out.format("<bounds minlat='%.8f' minlon='%.8f' maxlat='%.8f' maxlon='%.8f'/>%n",
-				Math.toDegrees(map.bounds.minlat), Math.toDegrees(map.bounds.minlon), Math.toDegrees(map.bounds.maxlat), Math.toDegrees(map.bounds.maxlon));
-
-		for (long id : map.index.keySet()) {
-			Feature feature = map.index.get(id);
-			String type = S57obj.stringType(feature.type);
-			if (!type.isEmpty() && (types.isEmpty() || types.contains(feature.type))) {
-				if (feature.reln == Rflag.MASTER) {
-					if (feature.geom.prim == Pflag.POINT) {
-						for (Prim prim : feature.geom.elems) {
-							long ref = prim.id;
-							Snode node;
-							while ((node = map.nodes.get(ref)) != null) {
-								if (!done.contains(ref)) {
-									out.format("  <node id='%d' lat='%.8f' lon='%.8f' version='1'>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon));
-									out.format("    <tag k='seamark:type' v=\"%s\"/>%n", type);
-									if ((feature.type == Obj.SOUNDG) && (node.flg == S57map.Nflag.DPTH))
-										out.format("    <tag k='seamark:sounding:depth' v='%.1f'/>%n", ((Snode) node).val);
-									writeAtts(feature);
-									out.format("  </node>%n");
-									done.add(ref);
-								}
-								ref++;
-							}
-						}
-					}
-				}
-			}
-		}
-		for (long id : map.index.keySet()) {
-			Feature feature = map.index.get(id);
-			String type = S57obj.stringType(feature.type);
-			if (!type.isEmpty() && (types.isEmpty() || types.contains(feature.type))) {
-				if (feature.reln == Rflag.MASTER) {
-					if ((feature.geom.prim == Pflag.LINE) || ((feature.geom.prim == Pflag.AREA) && (feature.geom.outers == 1) && (feature.geom.inners == 0))) {
-						GeomIterator git = map.new GeomIterator(feature.geom);
-						while (git.hasComp()) {
-							git.nextComp();
-							while (git.hasEdge()) {
-								git.nextEdge();
-								while (git.hasNode()) {
-									long ref = git.nextRef();
-									Snode node = map.nodes.get(ref);
-									if (!done.contains(ref)) {
-										out.format("  <node id='%d' lat='%.8f' lon='%.8f' version='1'/>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon));
-										done.add(ref);
-									}
-								}
-							}
-						}
-						git = map.new GeomIterator(feature.geom);
-						while (git.hasComp()) {
-							long edge = git.nextComp();
-							out.format("  <way id='%d' version='1'>%n", -edge);
-							while (git.hasEdge()) {
-								git.nextEdge();
-								while (git.hasNode()) {
-									long ref = git.nextRef();
-									out.format("    <nd ref='%d'/>%n", -ref);
-								}
-							}
-							out.format("    <tag k='seamark:type' v='%s'/>%n", type);
-							writeAtts(feature);
-							out.format("  </way>%n");
-						}
-					} else if (feature.geom.prim == Pflag.AREA) {
-						GeomIterator git = map.new GeomIterator(feature.geom);
-						while (git.hasComp()) {
-							git.nextComp();
-							while (git.hasEdge()) {
-								git.nextEdge();
-								while (git.hasNode()) {
-									long ref = git.nextRef();
-									Snode node = map.nodes.get(ref);
-									if (!done.contains(ref)) {
-										out.format("  <node id='%d' lat='%.8f' lon='%.8f' version='1'/>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon));
-										done.add(ref);
-									}
-								}
-							}
-						}
-						git = map.new GeomIterator(feature.geom);
-						while (git.hasComp()) {
-							long ref = git.nextComp();
-							out.format("  <way id='%d' version='1'>%n", -ref);
-							while (git.hasEdge()) {
-								git.nextEdge();
-								while (git.hasNode()) {
-									ref = git.nextRef();
-									out.format("    <nd ref='%d'/>%n", -ref);
-								}
-							}
-							out.format("  </way>%n");
-						}
-						out.format("  <relation id='%d' version='1'>%n", -map.xref++);
-						out.format("    <tag k='type' v='multipolygon'/>%n");
-						git = map.new GeomIterator(feature.geom);
-						int outers = feature.geom.outers;
-						while (git.hasComp()) {
-							long ref = git.nextComp();
-							if (outers-- > 0) {
-								out.format("    <member type='way' ref='%d' role='outer'/>%n", -ref);
-							} else {
-								out.format("    <member type='way' ref='%d' role='inner'/>%n", -ref);
-							}
-						}
-						out.format("    <tag k='seamark:type' v='%s'/>%n", type);
-						writeAtts(feature);
-						out.format("  </relation>%n");
-					}
-				}
-			}
-		}
-		out.println("</osm>\n");
-		out.close();
-		System.err.println("Finished");
-	}
-	
-	static void writeAtts(Feature feature) {
-		for (Map.Entry<Att, AttVal<?>> item : feature.atts.entrySet()) {
-			String attstr = S57att.stringAttribute(item.getKey());
-			String valstr = S57val.stringValue(item.getValue(), item.getKey());
-			if (!attstr.isEmpty() && !valstr.isEmpty()) {
-				if (typatts.contains(item.getKey())) {
-					out.format("    <tag k='seamark:%s' v='%s'/>%n", attstr, StringEscapeUtils.escapeXml10(valstr));
-				} else {
-					out.format("    <tag k='seamark:%s:%s' v='%s'/>%n", S57obj.stringType(feature.type), attstr, StringEscapeUtils.escapeXml10(valstr));
-				}
-			}
-		}
-		for (Obj obj : feature.objs.keySet()) {
-			ObjTab tab = feature.objs.get(obj);
-			for (int ix : tab.keySet()) {
-				AttMap atts = tab.get(ix);
-				for (Map.Entry<Att, AttVal<?>> item : atts.entrySet()) {
-					String attstr = S57att.stringAttribute(item.getKey());
-					String valstr = S57val.stringValue(item.getValue(), item.getKey());
-					if (!attstr.isEmpty() && !valstr.isEmpty()) {
-						if ((ix == 0) && (tab.size() == 1)) {
-							out.format("    <tag k='seamark:%s:%s' v='%s'/>%n", S57obj.stringType(obj), attstr, StringEscapeUtils.escapeXml10(valstr));
-						} else {
-							out.format("    <tag k='seamark:%s:%d:%s' v='%s'/>%n", S57obj.stringType(obj), ix + 1, attstr, StringEscapeUtils.escapeXml10(valstr));
-						}
-					}
-				}
-			}
-		}
-	}
+    
+    static FileInputStream in;
+    static PrintStream out;
+    static S57map map;
+    static final ArrayList<Att> typatts = new ArrayList<>(); static {
+        typatts.add(Att.OBJNAM); typatts.add(Att.NOBJNM); typatts.add(Att.STATUS); typatts.add(Att.INFORM); typatts.add(Att.NINFOM);
+        typatts.add(Att.PEREND); typatts.add(Att.PERSTA); typatts.add(Att.CONDTN); typatts.add(Att.CONRAD); typatts.add(Att.CONVIS);
+    }
+    
+    public static void main(String[] args) throws IOException {
+
+        ArrayList<Long> done = new ArrayList<>();
+
+        if (args.length < 3) {
+            System.err.println("Usage: java -jar js57toosm.jar S57_filename types_filename OSM_filename");
+            System.exit(-1);
+        }
+        try {
+            in = new FileInputStream(args[0]);
+        } catch (IOException e) {
+            System.err.println("Input file: " + e.getMessage());
+            System.exit(-1);
+        }
+        try {
+            out = new PrintStream(args[2]);
+        } catch (IOException e) {
+            System.err.println("Output file: " + e.getMessage());
+            in.close();
+            System.exit(-1);
+        }
+        ArrayList<Obj> types = new ArrayList<>();
+        try {
+            Scanner tin = new Scanner(new FileInputStream(args[1]));
+            while (tin.hasNext()) {
+                Obj type = S57obj.enumType(tin.next());
+                if (type != Obj.UNKOBJ)
+                    types.add(type);
+            }
+            tin.close();
+        } catch (IOException e) {
+            System.err.println("Types file: " + e.getMessage());
+            in.close();
+            out.close();
+            System.exit(-1);
+        }
+        
+        map = new S57map(true);
+        S57dec.decodeChart(in, map);
+
+        out.format("<?xml version='1.0' encoding='UTF-8'?>%n");
+        out.format("<osm version='0.6' upload='false' generator='js57toosm'>%n");
+        out.format("<bounds minlat='%.8f' minlon='%.8f' maxlat='%.8f' maxlon='%.8f'/>%n",
+                Math.toDegrees(map.bounds.minlat), Math.toDegrees(map.bounds.minlon), Math.toDegrees(map.bounds.maxlat), Math.toDegrees(map.bounds.maxlon));
+
+        for (long id : map.index.keySet()) {
+            Feature feature = map.index.get(id);
+            String type = S57obj.stringType(feature.type);
+            if (!type.isEmpty() && (types.isEmpty() || types.contains(feature.type))) {
+                if (feature.reln == Rflag.MASTER) {
+                    if (feature.geom.prim == Pflag.POINT) {
+                        for (Prim prim : feature.geom.elems) {
+                            long ref = prim.id;
+                            Snode node;
+                            while ((node = map.nodes.get(ref)) != null) {
+                                if (!done.contains(ref)) {
+                                    out.format("  <node id='%d' lat='%.8f' lon='%.8f' version='1'>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon));
+                                    out.format("    <tag k='seamark:type' v=\"%s\"/>%n", type);
+                                    if ((feature.type == Obj.SOUNDG) && (node.flg == S57map.Nflag.DPTH))
+                                        out.format("    <tag k='seamark:sounding:depth' v='%.1f'/>%n", ((Snode) node).val);
+                                    writeAtts(feature);
+                                    out.format("  </node>%n");
+                                    done.add(ref);
+                                }
+                                ref++;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        for (long id : map.index.keySet()) {
+            Feature feature = map.index.get(id);
+            String type = S57obj.stringType(feature.type);
+            if (!type.isEmpty() && (types.isEmpty() || types.contains(feature.type))) {
+                if (feature.reln == Rflag.MASTER) {
+                    if ((feature.geom.prim == Pflag.LINE) || ((feature.geom.prim == Pflag.AREA) && (feature.geom.outers == 1) && (feature.geom.inners == 0))) {
+                        GeomIterator git = map.new GeomIterator(feature.geom);
+                        while (git.hasComp()) {
+                            git.nextComp();
+                            while (git.hasEdge()) {
+                                git.nextEdge();
+                                while (git.hasNode()) {
+                                    long ref = git.nextRef();
+                                    Snode node = map.nodes.get(ref);
+                                    if (!done.contains(ref)) {
+                                        out.format("  <node id='%d' lat='%.8f' lon='%.8f' version='1'/>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon));
+                                        done.add(ref);
+                                    }
+                                }
+                            }
+                        }
+                        git = map.new GeomIterator(feature.geom);
+                        while (git.hasComp()) {
+                            long edge = git.nextComp();
+                            out.format("  <way id='%d' version='1'>%n", -edge);
+                            while (git.hasEdge()) {
+                                git.nextEdge();
+                                while (git.hasNode()) {
+                                    long ref = git.nextRef();
+                                    out.format("    <nd ref='%d'/>%n", -ref);
+                                }
+                            }
+                            out.format("    <tag k='seamark:type' v='%s'/>%n", type);
+                            writeAtts(feature);
+                            out.format("  </way>%n");
+                        }
+                    } else if (feature.geom.prim == Pflag.AREA) {
+                        GeomIterator git = map.new GeomIterator(feature.geom);
+                        while (git.hasComp()) {
+                            git.nextComp();
+                            while (git.hasEdge()) {
+                                git.nextEdge();
+                                while (git.hasNode()) {
+                                    long ref = git.nextRef();
+                                    Snode node = map.nodes.get(ref);
+                                    if (!done.contains(ref)) {
+                                        out.format("  <node id='%d' lat='%.8f' lon='%.8f' version='1'/>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon));
+                                        done.add(ref);
+                                    }
+                                }
+                            }
+                        }
+                        git = map.new GeomIterator(feature.geom);
+                        while (git.hasComp()) {
+                            long ref = git.nextComp();
+                            out.format("  <way id='%d' version='1'>%n", -ref);
+                            while (git.hasEdge()) {
+                                git.nextEdge();
+                                while (git.hasNode()) {
+                                    ref = git.nextRef();
+                                    out.format("    <nd ref='%d'/>%n", -ref);
+                                }
+                            }
+                            out.format("  </way>%n");
+                        }
+                        out.format("  <relation id='%d' version='1'>%n", -map.xref++);
+                        out.format("    <tag k='type' v='multipolygon'/>%n");
+                        git = map.new GeomIterator(feature.geom);
+                        int outers = feature.geom.outers;
+                        while (git.hasComp()) {
+                            long ref = git.nextComp();
+                            if (outers-- > 0) {
+                                out.format("    <member type='way' ref='%d' role='outer'/>%n", -ref);
+                            } else {
+                                out.format("    <member type='way' ref='%d' role='inner'/>%n", -ref);
+                            }
+                        }
+                        out.format("    <tag k='seamark:type' v='%s'/>%n", type);
+                        writeAtts(feature);
+                        out.format("  </relation>%n");
+                    }
+                }
+            }
+        }
+        out.println("</osm>\n");
+        out.close();
+        System.err.println("Finished");
+    }
+    
+    static void writeAtts(Feature feature) {
+        for (Map.Entry<Att, AttVal<?>> item : feature.atts.entrySet()) {
+            String attstr = S57att.stringAttribute(item.getKey());
+            String valstr = S57val.stringValue(item.getValue(), item.getKey());
+            if (!attstr.isEmpty() && !valstr.isEmpty()) {
+                if (typatts.contains(item.getKey())) {
+                    out.format("    <tag k='seamark:%s' v='%s'/>%n", attstr, StringEscapeUtils.escapeXml10(valstr));
+                } else {
+                    out.format("    <tag k='seamark:%s:%s' v='%s'/>%n", S57obj.stringType(feature.type), attstr, StringEscapeUtils.escapeXml10(valstr));
+                }
+            }
+        }
+        for (Obj obj : feature.objs.keySet()) {
+            ObjTab tab = feature.objs.get(obj);
+            for (int ix : tab.keySet()) {
+                AttMap atts = tab.get(ix);
+                for (Map.Entry<Att, AttVal<?>> item : atts.entrySet()) {
+                    String attstr = S57att.stringAttribute(item.getKey());
+                    String valstr = S57val.stringValue(item.getValue(), item.getKey());
+                    if (!attstr.isEmpty() && !valstr.isEmpty()) {
+                        if ((ix == 0) && (tab.size() == 1)) {
+                            out.format("    <tag k='seamark:%s:%s' v='%s'/>%n", S57obj.stringType(obj), attstr, StringEscapeUtils.escapeXml10(valstr));
+                        } else {
+                            out.format("    <tag k='seamark:%s:%d:%s' v='%s'/>%n", S57obj.stringType(obj), ix + 1, attstr, StringEscapeUtils.escapeXml10(valstr));
+                        }
+                    }
+                }
+            }
+        }
+    }
 
 }
