logo separator

[mkgmap-dev] Style functions

From Steve Ratcliffe steve at parabola.me.uk on Tue Sep 4 16:04:38 BST 2012

Hi WanMil

Thanks for implementing this.

> Steve: can you have a look on it and give your comment if the
> implementation looks good to you and what you dislike and what you want
> to change :-) Can you please also give a hint how I can tell the
> optimizer that functions should always be treated as an existing tag.
> Do you think it makes more sense to implement the functions as an
> additional operator?

Yes, I believe does make more sense to do that. I think that means
that the Op.value() method would have to change to take a Element
argument. You could also say that the normal tag match is a function
too, where the function is Element.getTag()

It looks like testing if the function applies to lines, points etc is
done at run time. This could probably be done at compile time, since
you know if it is a point or line rule at style compile time.

I don't much like the name mkgmap::length name, better would be
function::length or even just length().

There is no way to test a condition against every element, so another
term is required to select the elements that the function applies to.
So far this doesn't much matter since the uses are things like 'roads
shorter than some length'. Of course an error should be given if
something that can't be done is attempted. I suspect that would be
easier if there was a FunctionOp :)

Best wishes

..Steve



More information about the mkgmap-dev mailing list