logo separator

[mkgmap-dev] Bug in subst

From Colin Smale colin.smale at xs4all.nl on Wed May 28 07:45:51 BST 2014

 

Hi, 

Is this the best way to make bug reports? I couldn't find a 'trac' for
mkgmap... 

Using r3230, if I have the following in a style file: 

name=* & highway=* {set name='${name|subst:^(Doctor|Dokter) ~>Dr }'} 

then mkgmap crashes while loading the style files. After doing various
tests my conclusion is that it is triggered by the "|" in the pattern. I
tried escaping it with a backslash but it didn't change anything. 

I have found a kind-of workaround, by making the alternatives into
separate calls to subst, but that will result in enormously long
commands in the real use I have in mind. The example above is
deliberately short to illustrate the bug. 

The stack trace is: 

java.lang.IllegalStateException: No match found
 at java.util.regex.Matcher.group(Unknown Source)
 at
uk.me.parabola.mkgmap.osmstyle.actions.ValueBuilder.addFilter(ValueBuilder.java:168)
 at
uk.me.parabola.mkgmap.osmstyle.actions.ValueBuilder.addTagValue(ValueBuilder.java:156)
 at
uk.me.parabola.mkgmap.osmstyle.actions.ValueBuilder.compile(ValueBuilder.java:133)
 at
uk.me.parabola.mkgmap.osmstyle.actions.ValueBuilder.<init>(ValueBuilder.java:45)
 at
uk.me.parabola.mkgmap.osmstyle.actions.ValueBuilder.<init>(ValueBuilder.java:40)
 at
uk.me.parabola.mkgmap.osmstyle.actions.ValueBuildedAction.add(ValueBuildedAction.java:30)
 at
uk.me.parabola.mkgmap.osmstyle.actions.AddTagAction.<init>(AddTagAction.java:44)
 at
uk.me.parabola.mkgmap.osmstyle.actions.ActionReader.readTagValue(ActionReader.java:169)
 at
uk.me.parabola.mkgmap.osmstyle.actions.ActionReader.readActions(ActionReader.java:60)
 at
uk.me.parabola.mkgmap.osmstyle.RuleFileReader.loadFile(RuleFileReader.java:117)
 at
uk.me.parabola.mkgmap.osmstyle.RuleFileReader.checkCommand(RuleFileReader.java:192)
 at
uk.me.parabola.mkgmap.osmstyle.RuleFileReader.loadFile(RuleFileReader.java:109)
 at
uk.me.parabola.mkgmap.osmstyle.RuleFileReader.load(RuleFileReader.java:86)
 at
uk.me.parabola.mkgmap.osmstyle.StyleImpl.readRules(StyleImpl.java:302)
 at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:160)
 at
uk.me.parabola.mkgmap.osmstyle.StyleImpl.readStyle(StyleImpl.java:554)
 at
uk.me.parabola.mkgmap.reader.osm.RelationStyleHook.init(RelationStyleHook.java:38)
 at
uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.pluginChain(OsmMapDataSource.java:185)
 at
uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.setupHandler(OsmMapDataSource.java:153)
 at
uk.me.parabola.mkgmap.reader.osm.bin.OsmBinMapDataSource.load(OsmBinMapDataSource.java:49)
 at
uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.load(OsmMapDataSource.java:127)
 at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:167)
 at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:63)
 at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:220)
 at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:216)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
Exiting - if you want to carry on regardless, use the --keep-going
option
Time finished: Wed May 28 08:37:41 CEST 2014
Total time taken: 1124ms 

Thanks for a great program! 

Regards, 

Colin 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20140528/b367d223/attachment.html>


More information about the mkgmap-dev mailing list