logo separator

[mkgmap-dev] if-then-else in style and style options

From Gerd Petermann GPetermann_muenchen at hotmail.com on Fri Mar 17 10:09:05 GMT 2017

Hi Andrzej,

okay, so let's try to find out what is missing in the branch.
I like to add support for this short form:
A=1 & B=1 [0x1 resolution 24][0x10801 resolution 18]
# short form for
# A=1 & B=1 [0x1 resolution 24 continue]
# A=1 & B=1 [0x10801 resolution 18]
(note that continue has to be added by mkgmap)

I think we should not allow something like this:
A=1 & B=1 {name '...' } [0x1 resolution 24][0x10801 resolution 18]
as it is difficult to guess if mkgmap should add "continue" or "continue with_actions" but
I don't want to reject actions like echo or echotags which don't change the tags of an object:
A=1 & B=1 {echotags "test" } [0x1 resolution 24] [0x10801 resolution 18]

In short: If two (or more ? ) type definitions and action(s) are given we only allow actions which don't change tags

I've implemented this with r3850 in the branch and I've also tried to remove the ambiguity in if statements like
if (...) then
 {name '...' }
 [0x1 resolution 12]
end
where it wasn't clear if we have one or two rules in the if block.

Now one has to write
if (...) then
 () {name '...' }
 [0x1 resolution 12]
end
if one rule is wanted or
if (...) then
 () {name '...' }
 () [0x1 resolution 12]
end
for two rules.

I can also disallow the trick with () completely.

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej at poczta.onet.pl>
Gesendet: Donnerstag, 16. März 2017 16:30:24
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] if-then-else in style and style options

Hi Gerd,

if-then-else is great. The last problem with admin boundaries doesn't
change it. We can apply the same the basic syntax for a rule, regardless
if inside or outside of if-then-else condition and simply accept, that
rules for boundaries can't be rewritten with if-then-else. They are
simple rules, so no much gain anyway.

For me the primary application for if-then-else would be with
style-option, like this:

if (mkgmap:option:...=true) then
   ...
else
   ...
end

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


More information about the mkgmap-dev mailing list