logo separator

[mkgmap-dev] Is height: filter working as described?

From Gerd Petermann GPetermann_muenchen at hotmail.com on Thu Feb 2 10:18:05 GMT 2017

Hi Carlos,

this seems to be a problem in the documentation. I found this description for the height filter:
"This is exactly the same as the conv filter, except that it prepends a special separation character before the value
which is intended for elevations."
${ele|height:"m=>ft"}


This can be easily confused with the example for the conv filter:
${height|conv:"m=>ft"}

Looking at the source code the description for height seems okay.
In your examples the rule doesn't place the argument in "", maybe that is the problem?

Gerd
________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam at orangecorreo.es>
Gesendet: Donnerstag, 2. Februar 2017 10:45:02
An: Development list for mkgmap
Betreff: [mkgmap-dev] Is height: filter working as described?

According to style manual the rule
natural=peak {name '${name|def:}${ele|height:m=>ft|def:}' } [0x6616
resolution 24]
from default style should convert ele values from meters to feet,
assuming ele is in meters, but this is what map shows for the following
ele values:
ele=500, map: ", 500 m"
ele=500m, map: ", 500 m"
ele=500ft, map: ", 152 m"
So it seems to be doing right the opposite, converting from feet to
meters. Also, with m=>ft rule, map should show ft units, not m.
If I invert the rule from m=>ft to ft=>m this is what happens:
ele=500, map: ", 46 m"
ele=500m, map: ", 152 m"
ele=500ft, map: ", 46 m"
Now it seems when values are in feet conversion factor is applied twice.
It seems when height: is used it always does a ft to m conversion first
and then it applies what is specified in the rule.
For the same examples, conv: filter gives the right values.
_______________________________________________
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