Drawing order when using overlays

Hi, currently I'm trying to use the (not very well documented) "overlays" style file. It seems to work, but I can not figure out the drawing order of the created ways. They seem to draw "somehow", which means I can not reliably draw one line style over another. I tried the command line argument "--preserve-element-order", but it doesn't help. Could anybody point me in the right direction here? My overlays file is: -- 0x12c: 0x2c, 0x02, 0x2c 0x12d: 0x2d, 0x02, 0x2d 0x12e: 0x2e, 0x02, 0x2e 0x12f: 0x2f, 0x02, 0x2f 0x136: 0x36, 0x06, 0x36 0x137: 0x37, 0x06, 0x37 0x138: 0x38, 0x06, 0x38 0x139: 0x39, 0x06, 0x39 -- Nonetheless the line style 0x06 for example gets drawn above the 0x36. :( Thanks! Thilo

Hi, I just compiled r1006 and it throwed this exception at me when using: Jonathan:~/Projects/eclipse/mkgmap/dist chaos$ java -jar mkgmap.jar -- list-styles The following styles are available: Exception in thread "main" java.lang.IllegalStateException: zip file closed at java.util.zip.ZipFile.ensureOpen(ZipFile.java:518) at java.util.zip.ZipFile.getEntry(ZipFile.java:251) at java.util.jar.JarFile.getEntry(JarFile.java:204) at sun.net.www.protocol.jar.URLJarFile.getEntry (URLJarFile.java:90) at sun.net.www.protocol.jar.JarURLConnection.connect (JarURLConnection.java:112) at sun.net.www.protocol.jar.JarURLConnection.getJarFile (JarURLConnection.java:69) at uk.me.parabola.mkgmap.osmstyle.JarFileLoader.jarInit (JarFileLoader.java:76) at uk.me.parabola.mkgmap.osmstyle.JarFileLoader.<init> (JarFileLoader.java:54) at uk.me.parabola.mkgmap.osmstyle.StyleFileLoader.classpathLoader (StyleFileLoader.java:155) at uk.me.parabola.mkgmap.osmstyle.StyleFileLoader.createStyleLoader (StyleFileLoader.java:78) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init> (StyleImpl.java:116) at uk.me.parabola.mkgmap.main.Main.listStyles(Main.java:215) at uk.me.parabola.mkgmap.main.Main.processOption(Main.java:185) at uk.me.parabola.mkgmap.CommandArgs$CommandOption.processArg (CommandArgs.java:381) at uk.me.parabola.mkgmap.CommandArgs.readArgs (CommandArgs.java:119) at uk.me.parabola.mkgmap.main.Main.main(Main.java:91) Is it me or the software doing something wrong here? Regards Stefan

Hi Stefan,
Is it me or the software doing something wrong here?
I don't know but this is what I get with the same version of mkgmap: ~/OSM[master]$ java -jar mkgmap.jar --list-styles The following styles are available: default 1.0: The default style noname 1.0: The default style test 1.0: The default style ~/OSM[master]$ java -version java version "1.6.0_07" Java(TM) SE Runtime Environment (build 1.6.0_07-b06) Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing) Cheers, Mark

Hi Mark
Is it me or the software doing something wrong here?
I don't know but this is what I get with the same version of mkgmap:
~/OSM[master]$ java -jar mkgmap.jar --list-styles The following styles are available: default 1.0: The default style noname 1.0: The default style test 1.0: The default style
~/OSM[master]$ java -version java version "1.6.0_07" Java(TM) SE Runtime Environment (build 1.6.0_07-b06) Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
And there we go: java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-275) Java HotSpot(TM) Client VM (build 1.5.0_16-132, mixed mode, sharing) Ok, now I remember why I used my Windows machine instead of my Mac for doing anything with mkgmap. Switched to soylatte JRE-port and rebuild: build: BUILD SUCCESSFUL Total time: 2 seconds Yes, I could have figured that out for myself. Damn. Thanks anyway for the quick response! Regards Stefan

Hi again
~/OSM[master]$ java -jar mkgmap.jar --list-styles The following styles are available: default 1.0: The default style noname 1.0: The default style test 1.0: The default style
~/OSM[master]$ java -version java version "1.6.0_07" Java(TM) SE Runtime Environment (build 1.6.0_07-b06) Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
Sorry I messed that up. I encountered problems compiling splitter also related to the 1.5 java version on my Mac OS 10.4. The 'BUILDING SUCCESSFULL' message was from that. Jonathan:~/Projects/eclipse/mkgmap/dist chaos$ /usr/local/soylatte/ bin/java -version java version "1.6.0_03-p3" Java(TM) SE Runtime Environment (build 1.6.0_03-p3- landonf_19_aug_2008_14_55-b00) Java HotSpot(TM) Server VM (build 1.6.0_03-p3- landonf_19_aug_2008_14_55-b00, mixed mode) Jonathan:~/Projects/eclipse/mkgmap/dist chaos$ /usr/local/soylatte/ bin/java -jar mkgmap.jar --list-styles The following styles are available: default 1.0: The default style noname 1.0: The default style test 1.0: The default style This would have been the appropriate answer. Btw: Isn't it worth mentioning somewhere (or maybe IS it mentioned somewhere?) that mkgmap needs Java 1.6 and will therefore not compile on MacOS X 10.4 (Tiger)? I'm not sure but I think even 10.5 (Leopard) hasn't got a 1.6 JDK. You have to either find a working Developers Preview Version (I found none for 10.4) or get SoyLatte, which is a proof-of-concept kind of 1.6 port to Mac and needs some fiddeling around to install, integrate in eclipse and use in the terminal. I don't think you need to fix that. It's the right of the developer to choose his tools. But it may be stated somewhere that it's not as cross-platform as the java-sign suggests. Regards Stefan PS: I just looked in the README fie, where it states java 1.5 would be sufficient. Well that's not true for me here.

On Mon, Apr 20, 2009 at 11:33 AM, Stefan Aschenbach <stefan@binaervarianz.de> wrote:
Btw: Isn't it worth mentioning somewhere (or maybe IS it mentioned somewhere?) that mkgmap needs Java 1.6 and will therefore not compile on MacOS X 10.4 (Tiger)? I'm not sure but I think even 10.5 (Leopard) hasn't got a 1.6 JDK. You have to either find a working Developers Preview Version (I found none for 10.4) or get SoyLatte, which is a proof-of-concept kind of 1.6 port to Mac and needs some fiddeling around to install, integrate in eclipse and use in the terminal.
That's strange. I use mgkmap all the time on my Mac, and have never had a problem. Until recently, I used 10.4 (with soylatte for splitter.jar). 10.5 (after several service packages) does come with Java 1.6, but it is not the default. I often switch between Java 1.5 and 1.6 while compiling maps, and have not noted a difference. - Up to now, however, I have never tried the --list-styles mkgmap option. Could it be that there is something here requiring 1.6? Or something else? I will try this later on on my Mac. Cheers.

i also had newer problem with mkmap on my mbp with 10.5.x and Java 1.5/1.6 but i cant compile the splitter svn all the time ... [javac] Compiling 16 source files to /Users/MEMEME/svn/splitter/build/classes [javac] /Users/MEMEME/svn/splitter/src/uk/me/parabola/splitter/AreaList.java:73: cannot find symbol [javac] symbol : variable ROOT [javac] location: class java.util.Locale [javac] pw.format(Locale.ROOT, "%d: %d,%d to %d,%d\n", have this error at arealist.java:73 and AreaList.java:77 and AreaList.java:110 and SubArea.java:93 Who can help ? -- Wikipedia -- http://tools.wikimedia.de/~flacus/IWLC/ OSM -- http://osm.flacus.de/

On Mon, Apr 20, 2009 at 3:22 PM, FlaBot <flabot@googlemail.com> wrote:
i also had newer problem with mkmap on my mbp with 10.5.x and Java 1.5/1.6 but i cant compile the splitter svn all the time ...
[javac] Compiling 16 source files to /Users/MEMEME/svn/splitter/build/classes [javac] /Users/MEMEME/svn/splitter/src/uk/me/parabola/splitter/AreaList.java:73: cannot find symbol [javac] symbol : variable ROOT [javac] location: class java.util.Locale [javac] pw.format(Locale.ROOT, "%d: %d,%d to %d,%d\n",
Er... are you setting your CLASSPATH environment variable correctly? In 10.5 it is not sufficient to change the symlink to the Java 1.6 binary: you also must set CLASSPATH to the proper directory of the Java 1.6 framework. I'll see if I have time to look this up later today. Cheers.

On Mon, Apr 20, 2009 at 3:22 PM, FlaBot <flabot@googlemail.com> wrote:
i also had newer problem with mkmap on my mbp with 10.5.x and Java 1.5/1.6 but i cant compile the splitter svn all the time ...
This is what I do to compile splitter.jar on my 10.5 OS X system: $ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/home $ export PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/home/bin:$PATH $ java -version java version "1.6.0_07" Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153) Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode) $ ant build Buildfile: build.xml prepare: [mkdir] Created dir: /Users/blarg/dev/mkgmap/mkgmap-splitter copy/build/classes compile: [javac] Compiling 21 source files to /Users/blarg/dev/mkgmap/mkgmap-splitter copy/build/classes build: BUILD SUCCESSFUL Total time: 1 second $ ant dist Buildfile: build.xml [...] BUILD SUCCESSFUL Total time: 0 seconds When I had 10.4 installed, I did something similar with soylatte. Hope this helps.

Quoting Clinton Gladstone <clinton.gladstone@googlemail.com>:
On Mon, Apr 20, 2009 at 3:22 PM, FlaBot <flabot@googlemail.com> wrote:
i also had newer problem with mkmap on my mbp with 10.5.x and Java 1.5/1.6 but i cant compile the splitter svn all the time ...
This is what I do to compile splitter.jar on my 10.5 OS X system:
$ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/home $ export PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/home/bin:$PATH [...]
When I had 10.4 installed, I did something similar with soylatte.
I have 10.4 here. I haven"t tried the exports with 1.5 yet, but when using soylatte, i didn't need to export any variable to make it work. (I had the same errors when compiling with 1.5 in the first place). regards Stefan

Btw: Isn't it worth mentioning somewhere (or maybe IS it mentioned somewhere?) that mkgmap needs Java 1.6 and will therefore not compile on MacOS X 10.4 (Tiger)?
The situation is that mkgmap requires 1.5 and splitter requires 1.6. The problem with list styles is maybe a bug in 1.5. Anyway I have committed a fix for the problem. ..Steve

Below is a patch that allows the splitter to build against Java 5 (on MacOS 10.5). Only four lines of the code couldn't be compiled with Java 5 and those were easy to downgrade. Beware: It compiles, but that doesn't mean that it works correctly, there may be some difference between Java 5 and 6 that I missed. Having said that it seems to work ok for me. Try at your own risk. Index: src/uk/me/parabola/splitter/AreaList.java =================================================================== --- src/uk/me/parabola/splitter/AreaList.java (revision 31) +++ src/uk/me/parabola/splitter/AreaList.java (working copy) @@ -63,6 +63,8 @@ w = new FileWriter(filename); PrintWriter pw = new PrintWriter(w); + Locale rootlocale = new Locale("", "", ""); + pw.println("# List of areas"); pw.format("# Generated %s\n", new Date()); //pw.format("# Options: max-nodes=%d\n", main.getMaxNodes()); @@ -70,11 +72,11 @@ for (SubArea a : areas) { Area b = a.getBounds(); - pw.format(Locale.ROOT, "%d: %d,%d to %d,%d\n", + pw.format(rootlocale, "%d: %d,%d to %d,%d\n", a.getMapid(), b.getMinLat(), b.getMinLong(), b.getMaxLat(), b.getMaxLong()); - pw.format(Locale.ROOT, "# : %f,%f to %f,%f\n", + pw.format(rootlocale, "# : %f,%f to %f,%f\n", Utils.toDegrees(b.getMinLat()), Utils.toDegrees(b.getMinLong()), Utils.toDegrees(b.getMaxLat()), Utils.toDegrees(b.getMaxLong())); pw.println(); @@ -107,7 +109,7 @@ String line; while ((line = br.readLine()) != null) { line = line.trim(); - if (line.isEmpty() || line.charAt(0) == '#') + if ((line != null && line.length() == 0) || line.charAt(0) == '#') continue; Matcher matcher = pattern.matcher(line); Index: src/uk/me/parabola/splitter/SubArea.java =================================================================== --- src/uk/me/parabola/splitter/SubArea.java (revision 31) +++ src/uk/me/parabola/splitter/SubArea.java (working copy) @@ -90,7 +90,8 @@ bounds.getMaxLat() + extra, bounds.getMaxLong() + extra); - String filename = new Formatter().format(Locale.ROOT, "%08d.osm.gz", mapid).toString(); + Locale rootlocale = new Locale("", "", ""); + String filename = new Formatter().format(rootlocale, "%08d.osm.gz", mapid).toString(); try { FileOutputStream fos = new FileOutputStream(filename); OutputStream zos = new GZIPOutputStream(fos);

On Tue, Apr 21, 2009 at 01:02:39AM +0200, Thilo Hannemann wrote:
while ((line = br.readLine()) != null) { line = line.trim(); - if (line.isEmpty() || line.charAt(0) == '#') + if ((line != null && line.length() == 0) || line.charAt(0) == '#') continue;
Matcher matcher = pattern.matcher(line);
Why the line != null? I wouldn't expect line.trim() to return null or pattern.matcher() to accept null. Also, would one public static Locale rootlocale in some class suffice? Your patch is initializing rootlocale as a local variable, in two places. Marko

Hi Marko, you are right. I did the replacement too "locally". But the patch was more to try whether it works at all, because I don't know whether it wants Java 6 just due to those lines or whether there is another (less obvious) reason. Am 21.04.2009 um 07:37 schrieb Marko Mäkelä:
On Tue, Apr 21, 2009 at 01:02:39AM +0200, Thilo Hannemann wrote:
while ((line = br.readLine()) != null) { line = line.trim(); - if (line.isEmpty() || line.charAt(0) == '#') + if ((line != null && line.length() == 0) || line.charAt(0) == '#') continue;
Matcher matcher = pattern.matcher(line);
Why the line != null? I wouldn't expect line.trim() to return null or pattern.matcher() to accept null.
Also, would one public static Locale rootlocale in some class suffice? Your patch is initializing rootlocale as a local variable, in two places.
Marko _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (8)
-
Clinton Gladstone
-
FlaBot
-
Mark Burton
-
Marko Mäkelä
-
Stefan Aschenbach
-
stefan@binaervarianz.de
-
Steve Ratcliffe
-
Thilo Hannemann