logo separator

[mkgmap-dev] Self-compiled r2008 doesn't work with PBF input

From Colin Smale colin.smale at xs4all.nl on Fri Jul 29 14:09:08 BST 2011

Hi,

I am trying to switch over to mkgmap r2008 with splitter r179. If I use 
the jars from the download page it all works fine. But if I recompile 
mkgmap.jar (using Idea 10.5.1) from the r2008 sources I just get a bunch 
of errors in mkgmap.log, one for each input file:

Error at line 1, col 1
Bad file format: 63240001.osm.pbf
Error parsing file

I notice my jar file is much smaller than the precompiled one (1173kb 
instead of 1684kb). My (experimental) changes are trivial by the way; 
the patch is listed below. I don't see how this change can cause this 
error.

I know this problem has been reported before, and I have made sure I am 
using the right jar files by simply replacing mkgmap.jar with my version.

Does anybody have any idea what might be going wrong?

Thanks in advance,
Colin


Index: src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java    (revision 
2008)
+++ src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java    (revision )
@@ -589,6 +589,9 @@
          String ref = Label.squashSpaces(element.getTag("ref"));
          String int_ref = Label.squashSpaces(element.getTag("int_ref"));
          if(int_ref != null) {
+            // Colin Smale, July 2011
+            // remove space from European route number to stop it being 
read as 'East'
+            int_ref = int_ref.replaceAll("E *","E");
              if(ref == null)
                  ref = int_ref;
              else
@@ -615,13 +618,20 @@
      private void elementSetup(MapElement ms, GType gt, Element element) {
          String name = Label.squashSpaces(element.getName());
          String refs = combineRefs(element);
-
+
+        // Colin Smale, July 2011
+        // if there are multiple entries in refs, separate them with / 
instead of ;
+        if (refs != null)
+            refs = refs.replace(";","/");
+
          // Insert display_name as first ref.
          // This causes display_name to be displayed in routing
          // directions, instead of only the ref.
          String displayName = 
Label.squashSpaces(element.getTag("display_name"));

          if (displayName != null) {
+            // Colin Smale: remove spaces after ;
+            displayName = displayName.replaceAll(" *; *",";");
              // substitute '/' for ';' in display_name to avoid it
              // getting split below
              displayName = displayName.replace(";","/");





More information about the mkgmap-dev mailing list