logo separator

[mkgmap-dev] Convert filter improvements

From Steve Ratcliffe steve at parabola.me.uk on Fri Oct 31 11:22:21 GMT 2014


I wrote this during the summer after a conversation on the list with Felix.

Currently the convert filter will only convert from meters to feet as it
was for compatibility with some hard wired rule back before the style 
It also didn't work if the original value had a unit.


The patch allows for length conversions between m, km, mi, ft and
speed conversions of km/h (kmh, kmph), mph, knots. New ones can easily
be added.

It will also take into account any unit that already exists.

So for example if you have ${val|m=>ft}

Then val will be assumed to be in meters if there is no unit.

   val=10   --> 33

if a unit is given, then it converts from that, so if already in feet
the value will be unchanged.

   val=10ft --> 10
   val=10km --> 32,808

If it can't work out what to do then the value is unchanged.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Improve_ConvertFilter1.patch
Type: text/x-patch
Size: 15895 bytes
Desc: not available
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20141031/ef187559/attachment-0001.bin>

More information about the mkgmap-dev mailing list