logo separator

[mkgmap-dev] Numerical comparison of two tags

From Steve Ratcliffe steve at parabola.me.uk on Fri Nov 1 22:34:30 GMT 2013

On 01/11/13 12:50, Bernhard Hiller wrote:
> it is NOT POSSIBLE to compare the values of two tags with each other.

That is correct.

But it is now an easy thing to implement.  There are a few syntaxes
we could use such as:

   maxspeed < get_tag(maxspeed:forward)
   maxspeed < ${maxspeed:forward}

The attached patch implements the dollar notation. So the first part of 
your example could be written as:

   maxspeed:forward=* & maxspeed!=* { set maxspeed='${maxspeed:forward}' }
   maxspeed:forward=* & maxspeed:forward < ${maxspeed}
		{ set maxspeed='${maxspeed:forward}' }

Note there are no quotes around ${maxspeed}.

It's not limited to numeric comparisons, you could have:
   name != $name_int

Currently you can't just have one of these by itself, it has
to have another test first. I'm pretty sure that can be fixed, but
that's one for later.

(built jar: http://files.mkgmap.org.uk/download/161/mkgmap.jar)

..Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test_tag_value_against_tag_value.patch
Type: text/x-patch
Size: 1776 bytes
Desc: not available
URL: <http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20131101/44e7b708/attachment.bin>


More information about the mkgmap-dev mailing list