Hi,

I have tweaked my maps recently and tripped on some problems. Nothing serious, but a bit troublesome.

First I noticed, that tweak for better looking roundabouts not always works. In default style there is something like that:

junction=roundabout & (highway=tertiary | highway=tertiary_link) [0x0c road_class=1 road_speed=1 resolution 24 continue] junction=roundabout & (highway=tertiary | highway=tertiary_link) [0x10804 resolution 21]

I have noticed, that sometimes I get roundabout partially covered by line 0x10804. Maybe mkgmap is splitting roundabout and a part of it is written into img after line 0x10804? Sorry, I have reworked my style and can't provide an example now.

Then I got problems with --make-opposite-cycleways. Looks like this option is not executed at finalize step, but the created line gets full processing in style. If there exist somewhere a roundabout with opposite cycle line, then default style will create double lines 0x10804. Safe version of style would be:

mkgmap:synthesised!=yes & junction=roundabout & (highway=tertiary | highway=tertiary_link) [0x10804 resolution 21]

Then I have found that following doesn't work:

if (mkgmap:synthesised!=yes) then
junction=roundabout & (highway=tertiary | highway=tertiary_link) [0x10804 resolution 21]
end

Result:
Mkgmap version 4902
Time started: Sun May 29 21:47:50 CEST 2022
SEVERE (global): Error in style: Error: (lines:15): Invalid rule, expression cannot be indexed: $mkgmap:synthesised!=yes
SEVERE (global): Could not open style

But this one works:

if (mkgmap:synthesised=yes) then else
junction=roundabout & (highway=tertiary | highway=tertiary_link) [0x10804 resolution 21]
end

I understand, that there is some kind of optimization for keywords, but why one type of condition works while others don't? Mkgmap accepts "keyword=false" but not "keyword=!true" nor "!(keyword=true)". If this is unavoidable, then would be nice to get a warning in manual.

Finally I made an error in style and crashed mkgmap. I wrote something like this:

if (mkgmap:style-option:test=true) then
        () echo {"test"}
end

and got following:

Mkgmap version 4902
Time started: Sun May 29 21:06:03 CEST 2022
SEVERE (global): Unexpected error
java.lang.NullPointerException: Cannot invoke "uk.me.parabola.mkgmap.osmstyle.eval.Op.isType(uk.me.parabola.mkgmap.osmstyle.eval.NodeType)" because the return value of "uk.me.parabola.mkgmap.osmstyle.eval.Op.getFirst()" is null at uk.me.parabola.mkgmap.osmstyle.ExpressionArranger.selectivity(ExpressionArranger.java:381) at uk.me.parabola.mkgmap.osmstyle.ExpressionArranger.arrangeAndChain(ExpressionArranger.java:348) at uk.me.parabola.mkgmap.osmstyle.ExpressionArranger.arrangeTop(ExpressionArranger.java:95) at uk.me.parabola.mkgmap.osmstyle.ExpressionArranger.arrange(ExpressionArranger.java:74) at uk.me.parabola.mkgmap.osmstyle.RuleFileReader.loadFile(RuleFileReader.java:132) at uk.me.parabola.mkgmap.osmstyle.RuleFileReader.load(RuleFileReader.java:102)
        at 
uk.me.parabola.mkgmap.osmstyle.StyleImpl.readRules(StyleImpl.java:303)
        at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:158)
        at 
uk.me.parabola.mkgmap.osmstyle.StyleImpl.readStyle(StyleImpl.java:546)
at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.createConverter(OsmMapDataSource.java:324) at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.setupHandler(OsmMapDataSource.java:206) at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.parse(OsmMapDataSource.java:166) at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.load(OsmMapDataSource.java:142)
        at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:165)
        at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:58)
        at 
uk.me.parabola.mkgmap.main.Main.lambda$processFilename$1(Main.java:291)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
SEVERE (global): Exiting due to unexpected error
Number of ExitExceptions: 1


--
Best regards,
Andrzej
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to