Index: /applications/editors/josm/plugins/smed2/jsearch/src/jsearch/Extract.java
===================================================================
--- /applications/editors/josm/plugins/smed2/jsearch/src/jsearch/Extract.java	(revision 30411)
+++ /applications/editors/josm/plugins/smed2/jsearch/src/jsearch/Extract.java	(revision 30412)
@@ -10,9 +10,6 @@
 package jsearch;
 
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
+import java.io.*;
+import java.util.*;
 
 import jsearch.Jsearch.MapBB;
Index: /applications/editors/josm/plugins/smed2/jsearch/src/jsearch/Jsearch.java
===================================================================
--- /applications/editors/josm/plugins/smed2/jsearch/src/jsearch/Jsearch.java	(revision 30411)
+++ /applications/editors/josm/plugins/smed2/jsearch/src/jsearch/Jsearch.java	(revision 30412)
@@ -10,10 +10,6 @@
 package jsearch;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.HashMap;
+import java.io.*;
+import java.util.*;
 
 public class Jsearch {
@@ -223,8 +219,8 @@
 			int y = (t % 512) * 8;
 			MapBB bb = new MapBB();
-			bb.minlon = tile2lon((x + 4095) % 4096, 12);
-			bb.maxlon = tile2lon((x + 9) % 4095, 12);
-			bb.minlat = tile2lat(Math.min((y + 9), 4095), 12);
-			bb.maxlat = tile2lat(Math.max((y - 1), 0), 12);
+			bb.minlon = tile2lon((x + 4094) % 4096, 12);
+			bb.maxlon = tile2lon((x + 10) % 4095, 12);
+			bb.minlat = tile2lat(Math.min((y + 10), 4095), 12);
+			bb.maxlat = tile2lat(Math.max((y - 2), 0), 12);
 			ArrayList<String> ext = Extract.extractData(dir + "next.osm", bb);
 			PrintStream out = new PrintStream(dir + "tmp/" + (t / 512) + "-" + (t % 512) + "-9.osm");
@@ -238,8 +234,8 @@
 			int y = (t % 1024) * 4;
 			MapBB bb = new MapBB();
-			bb.minlon = tile2lon((x + 4095) % 4096, 12);
-			bb.maxlon = tile2lon((x + 5) % 4095, 12);
-			bb.minlat = tile2lat(Math.min((y + 5), 4095), 12);
-			bb.maxlat = tile2lat(Math.max((y - 1), 0), 12);
+			bb.minlon = tile2lon((x + 4094) % 4096, 12);
+			bb.maxlon = tile2lon((x + 6) % 4095, 12);
+			bb.minlat = tile2lat(Math.min((y + 6), 4095), 12);
+			bb.maxlat = tile2lat(Math.max((y - 2), 0), 12);
 			ArrayList<String> ext = Extract.extractData(dir + "tmp/" + ((t / 1024) / 2) + "-" + ((t % 1024) / 2) + "-9.osm", bb);
 			PrintStream out = new PrintStream(dir + "tmp/" + (t / 1024) + "-" + (t % 1024) + "-10.osm");
@@ -253,14 +249,33 @@
 			int y = (t % 2048) * 2;
 			MapBB bb = new MapBB();
-			bb.minlon = tile2lon((x + 4095) % 4096, 12);
-			bb.maxlon = tile2lon((x + 3) % 4095, 12);
-			bb.minlat = tile2lat(Math.min((y + 3), 4095), 12);
-			bb.maxlat = tile2lat(Math.max((y - 1), 0), 12);
+			bb.minlon = tile2lon((x + 4094) % 4096, 12);
+			bb.maxlon = tile2lon((x + 4) % 4095, 12);
+			bb.minlat = tile2lat(Math.min((y + 4), 4095), 12);
+			bb.maxlat = tile2lat(Math.max((y - 2), 0), 12);
 			ArrayList<String> ext = Extract.extractData(dir + "tmp/" + ((t / 2048) / 2) + "-" + ((t % 2048) / 2) + "-10.osm", bb);
-			PrintStream out = new PrintStream(dir + "tmp/" + (t / 2048) + "-" + (t % 2048) + "-11.osm");
+			String z11nam = dir + "tmp/" + (t / 2048) + "-" + (t % 2048) + "-11.osm";
+			PrintStream out = new PrintStream(z11nam);
 			for (String line : ext) {
 				out.println(line);
 			}
 			out.close();
+			for (int i = (x+4095)%4096; i < x+3; i = (i+1)%4096) {
+				for (int j = Math.max(y-1, 0); j < y+3; j = Math.min(j+1, 4095)) {
+					if (z12s.containsKey(i*4096+j)) {
+						z12s.remove(i*4096+j);
+						bb = new MapBB();
+						bb.minlon = tile2lon((i + 4095) % 4096, 12);
+						bb.maxlon = tile2lon((i + 2) % 4095, 12);
+						bb.minlat = tile2lat(Math.min((j + 2), 4095), 12);
+						bb.maxlat = tile2lat(Math.max((j - 1), 0), 12);
+						ext = Extract.extractData(z11nam, bb);
+						out = new PrintStream(dir + "tmp/" + i + "-" + j + "-12.osm");
+						for (String line : ext) {
+							out.println(line);
+						}
+						out.close();
+					}
+				}
+			}
 		}
 		
Index: /applications/editors/josm/plugins/smed2/jtile/src/jtile/Jtile.java
===================================================================
--- /applications/editors/josm/plugins/smed2/jtile/src/jtile/Jtile.java	(revision 30411)
+++ /applications/editors/josm/plugins/smed2/jtile/src/jtile/Jtile.java	(revision 30412)
@@ -30,8 +30,9 @@
 	static int xtile;
 	static int ytile;
+	static int zoom;
 	static ArrayList<String> send;
 	static HashMap<String, Boolean> deletes;
 
-	static void tile(int zoom, int dxy, int xn, int yn) throws Exception {
+	static void tile(int z, int dxy, int xn, int yn) throws Exception {
 
 		trans = new PNGTranscoder();
@@ -40,5 +41,5 @@
 		trans.addTranscodingHint(PNGTranscoder.KEY_AOI, new Rectangle(256+(xn*dxy), 256+(yn*dxy), dxy, dxy));
 
-		String svgURI = new File(srcdir + xtile + "-" + ytile + "-" + zoom + ".svg").toURI().toURL().toString();
+		String svgURI = new File(srcdir + xtile + "-" + ytile + "-" + z + ".svg").toURI().toURL().toString();
 		TranscoderInput input = new TranscoderInput(svgURI);
 		ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -46,18 +47,18 @@
 		trans.transcode(input, output);
 		if (bos.size() > 446) {
-			int scale = (int) Math.pow(2, zoom - 12);
+			int scale = (int) Math.pow(2, z - 12);
 			int xdir = (scale * xtile) + xn;
 			int ynam = (scale * ytile) + yn;
-			String dstnam = dstdir + zoom + "/" + xdir + "/" + ynam + ".png";
+			String dstnam = dstdir + z + "/" + xdir + "/" + ynam + ".png";
 			deletes.remove(dstnam);
-			send.add("put " + dstnam + " cache/tiles-" + zoom + "-" + xdir + "-" + ynam + ".png");
-			File ofile = new File(dstdir + "/" + zoom + "/" + xdir + "/");
+			send.add("put " + dstnam + " cache/tiles-" + z + "-" + xdir + "-" + ynam + ".png");
+			File ofile = new File(dstdir + "/" + z + "/" + xdir + "/");
 			ofile.mkdirs();
-			OutputStream ostream = new FileOutputStream(dstdir + "/" + zoom + "/" + xdir + "/" + ynam + ".png");
+			OutputStream ostream = new FileOutputStream(dstdir + "/" + z + "/" + xdir + "/" + ynam + ".png");
 			bos.writeTo(ostream);
 			ostream.flush();
 			ostream.close();
 			if (send.size() > 10) {
-				PrintWriter writer = new PrintWriter(srcdir + zoom  + "-" + xdir + "-" + ynam + ".send", "UTF-8");
+				PrintWriter writer = new PrintWriter(srcdir + z  + "-" + xdir + "-" + ynam + ".send", "UTF-8");
 				for (String str : send) {
 					writer.println(str);
@@ -67,8 +68,8 @@
 			}
 		}
-		if ((zoom < 18) && ((zoom < 16) || (bos.size() > 446))) {
+		if ((z < 18) && ((z < 16) || (bos.size() > 446))) {
 			for (int x = 0; x < 2; x++) {
 				for (int y = 0; y < 2; y++) {
-					tile((zoom + 1), (dxy / 2), (xn * 2 + x), (yn * 2 + y));
+					tile((z + 1), (dxy / 2), (xn * 2 + x), (yn * 2 + y));
 				}
 			}
@@ -76,10 +77,40 @@
 	}
 
-	static void clean(int zoom, int xn, int yn) throws Exception {
+	static void tile91011() throws Exception {
+
+		trans = new PNGTranscoder();
+		trans.addTranscodingHint(PNGTranscoder.KEY_WIDTH, new Float(256));
+		trans.addTranscodingHint(PNGTranscoder.KEY_HEIGHT, new Float(256));
+		trans.addTranscodingHint(PNGTranscoder.KEY_AOI, new Rectangle(512, 512, 256*(int)(Math.pow(2, 12-zoom)), 256*(int)(Math.pow(2, 12-zoom))));
+
+		String svgURI = new File(srcdir + xtile + "-" + ytile + "-" + zoom + ".svg").toURI().toURL().toString();
+		TranscoderInput input = new TranscoderInput(svgURI);
+		ByteArrayOutputStream bos = new ByteArrayOutputStream();
+		TranscoderOutput output = new TranscoderOutput(bos);
+		trans.transcode(input, output);
+		String dstnam = dstdir + zoom + "/" + xtile + "/" + ytile + ".png";
+		if (bos.size() > 446) {
+			send.add("put " + dstnam + " cache/tiles-" + zoom + "-" + xtile + "-" + ytile + ".png");
+			File ofile = new File(dstdir + "/" + zoom + "/" + xtile + "/");
+			ofile.mkdirs();
+			OutputStream ostream = new FileOutputStream(dstdir + "/" + zoom + "/" + xtile + "/" + ytile + ".png");
+			bos.writeTo(ostream);
+			ostream.flush();
+			ostream.close();
+		} else {
+			File old = new File(dstnam);
+			if (old.exists()) {
+				old.delete();
+				deletes.put(dstnam, true);
+			}
+		}
+	}
+
+	static void clean(int z, int xn, int yn) throws Exception {
 		
-		int scale = (int) Math.pow(2, zoom - 12);
+		int scale = (int) Math.pow(2, z - 12);
 		int xdir = (scale * xtile) + xn;
 		int ynam = (scale * ytile) + yn;
-		String delnam = dstdir + zoom + "/" + xdir + "/" + ynam + ".png";
+		String delnam = dstdir + z + "/" + xdir + "/" + ynam + ".png";
 		File delfile = new File(delnam);
 		if (delfile.exists()) {
@@ -87,8 +118,8 @@
 			delfile.delete();
 		}
-		if ((zoom < 18)) {
+		if ((z < 18)) {
 			for (int x = 0; x < 2; x++) {
 				for (int y = 0; y < 2; y++) {
-					clean((zoom + 1), (xn * 2 + x), (yn * 2 + y));
+					clean((z + 1), (xn * 2 + x), (yn * 2 + y));
 				}
 			}
@@ -99,12 +130,17 @@
 		srcdir = args[0];
 		dstdir = args[1];
-		xtile = Integer.parseInt(args[2]);
-		ytile = Integer.parseInt(args[3]);
+		zoom = Integer.parseInt(args[2]);
+		xtile = Integer.parseInt(args[3]);
+		ytile = Integer.parseInt(args[4]);
 		send = new ArrayList<String>();
 		deletes = new HashMap<String, Boolean>();
-		clean(12, 0, 0);
-		tile(12, 256, 0, 0);
-		if (send.size() > 0) {
-			PrintWriter writer = new PrintWriter(srcdir + "12-" + xtile + "-" + ytile + ".send", "UTF-8");
+		if (zoom == 12) {
+			clean(12, 0, 0);
+			tile(12, 256, 0, 0);
+		} else {
+			tile91011();
+		}
+		if ((send.size() + deletes.size()) > 0) {
+			PrintWriter writer = new PrintWriter(srcdir + zoom + "-" + xtile + "-" + ytile + ".send", "UTF-8");
 			for (String str : send) {
 				writer.println(str);
@@ -115,6 +151,10 @@
 			writer.close();
 		}
-		for (int z = 12; z <= 18; z++) {
-			(new File(srcdir + xtile + "-" + ytile + "-" + z + ".svg")).delete();
+		if (zoom == 12) {
+			for (int zz = 12; zz <= 18; zz++) {
+				(new File(srcdir + xtile + "-" + ytile + "-" + zz + ".svg")).delete();
+			}
+		} else {
+			(new File(srcdir + xtile + "-" + ytile + "-" + zoom + ".svg")).delete();
 		}
 		System.exit(0);
Index: /applications/editors/josm/plugins/smed2/src/render/Renderer.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/render/Renderer.java	(revision 30411)
+++ /applications/editors/josm/plugins/smed2/src/render/Renderer.java	(revision 30412)
@@ -25,5 +25,5 @@
 public class Renderer {
 
-	public static final double symbolScale[] = { 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.61, 0.372, 0.227, 0.138, 0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007, 0.138 };
+	public static final double symbolScale[] = { 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.61, 0.372, 0.227, 0.138, 0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007 };
 
 	public enum LabelStyle { NONE, RRCT, RECT, ELPS, CIRC, VCLR, PCLR, HCLR }
