<div dir="ltr">I'm sorry Gerd, I want to experiment with the new statements but I just don't have the time to play at the moment. Please commit the changes if you haven't already, and I'll get the new version and experiment when I can.<div><br></div><div>Dave</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 7, 2017 at 9:09 PM, Gerd Petermann <span dir="ltr"><<a href="mailto:GPetermann_muenchen@hotmail.com" target="_blank">GPetermann_muenchen@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Any feedback on this?<br>
<br>
If nobody is interested in using if-then-else in style I'd be happy to use only the style-option_v3.patch<br>
for trunk.<br>
<br>
Gerd<br>
______________________________<wbr>__________<br>
Von: mkgmap-dev <<a href="mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk">mkgmap-dev-bounces@lists.<wbr>mkgmap.org.uk</a>> im Auftrag von Gerd Petermann <<a href="mailto:GPetermann_muenchen@hotmail.com">GPetermann_muenchen@hotmail.<wbr>com</a>><br>
Gesendet: Mittwoch, 1. März 2017 15:54:02<br>
An: <a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
Betreff: [mkgmap-dev] if-then-else  in style and style options<br>
<br>
Hi all,<br>
<br>
I've applied the style-option_v3.patch to the branch, for details see  log message:<br>
<a href="http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=3827" rel="noreferrer" target="_blank">http://www.mkgmap.org.uk/<wbr>websvn/revision.php?repname=<wbr>mkgmap&rev=3827</a><br>
<br>
I've also tried to fix the known problems with the interpretation of if then statements,<br>
so I hope it works now:<br>
<a href="http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&path=%2F&" rel="noreferrer" target="_blank">http://www.mkgmap.org.uk/<wbr>websvn/revision.php?repname=<wbr>mkgmap&path=%2F&</a><br>
<br>
Just to make this clear: The if statements are translated to "normal" rules, so you cannot do anything<br>
with if-then which would not work without, you should also not (yet) exprect run time improvements.<br>
The advantage is that you don't have to repeat phrases.<br>
<br>
A complex sample that shows a possible usage.<br>
# Roundabouts<br>
if (junction=roundabout) then<br>
        if (mkgmap:option:single-<wbr>roundabout=true) then<br>
                (highway=trunk | highway=trunk_link) [0x0c road_class=4 road_speed=2 resolution 18]<br>
                (highway=primary | highway=primary_link) [0x0c road_class=3 road_speed=2 resolution 19]<br>
                (highway=secondary | highway=secondary_link) [0x0c road_class=2 road_speed=2 resolution 20]<br>
                (highway=tertiary | highway=tertiary_link) [0x0c road_class=1 road_speed=1 resolution 21]<br>
        else<br>
                (highway=trunk | highway=trunk_link) [0x0c road_class=4 road_speed=2 resolution 24 continue]<br>
                (highway=trunk | highway=trunk_link) [0x10801 resolution 18]<br>
<br>
                (highway=primary | highway=primary_link) [0x0c road_class=3 road_speed=2 resolution 24 continue]<br>
                (highway=primary | highway=primary_link) [0x10802 resolution 19]<br>
<br>
                (highway=secondary | highway=secondary_link) [0x0c road_class=2 road_speed=2 resolution 24 continue]<br>
                (highway=secondary | highway=secondary_link) [0x10803 resolution 20]<br>
<br>
                (highway=tertiary | highway=tertiary_link) [0x0c road_class=1 road_speed=1 resolution 24 continue]<br>
                (highway=tertiary | highway=tertiary_link) [0x10804 resolution 21]<br>
        end<br>
        # minor roundabouts need no overlay<br>
        (highway=unclassified | highway=minor ) [0x0c road_class=1 road_speed=1 resolution 21]<br>
        highway=* [0x0c road_class=0 road_speed=1 resolution 22]<br>
end<br>
<br>
If the corresponding block in the default style lines file is replaced with these rules, you can<br>
use option --style-option=single-<wbr>roundabout to enable the rules which don't add 0x180x lines as overlays for roundabouts.<br>
<br>
It might be possible to completely remove rules which would never be triggered but that is quite complex, so I leave that for later.<br>
<br>
Gerd<br>
______________________________<wbr>_________________<br>
mkgmap-dev mailing list<br>
<a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
<a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noreferrer" target="_blank">http://www.mkgmap.org.uk/<wbr>mailman/listinfo/mkgmap-dev</a><br>
______________________________<wbr>_________________<br>
mkgmap-dev mailing list<br>
<a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
<a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noreferrer" target="_blank">http://www.mkgmap.org.uk/<wbr>mailman/listinfo/mkgmap-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Dave Swarthout<br>Homer, Alaska<br>Chiang Mai, Thailand<br>Travel Blog at <a href="http://dswarthout.blogspot.com" target="_blank">http://dswarthout.blogspot.com</a></div></div>
</div>