Need help with string handling in mkgmap

Hi, i'm struggling with the following problem and until now, i didn't find a solution. It seems, that in osm sometimes the height or elevation tag is filled with the unit sign, i.e 'm' and sometimes not. So with my current point file i either get elevation without the unit letter or with double unit letter - i.e 'Mm'. How to handle this ? I tried with this height=* { set mkgmap:height='${height|subst:"m=>"}'} ele=* { set mkgmap:ele='${ele|subst:"m=>"}'} but it doesn't work -- Mit freundlichen Grüßen ##################################################### Manfred Haiduk, Zum Fischbach 9, 52393 Hürtgenwald e-mail mhaiduk@t-online.de #####################################################

Hi Manfred, maybe have a look at this rule from the default style: natural=peak {name '${name|def:}${ele|height:m=>ft|def:}' } [0x6616 resolution 24] It uses the height filter to convert the unit so that Garmin software shows the value in the wanted unit. I am not sure if Garmin software shows a unit, but it will show the correct value. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Manfred Haiduk <mhaiduk@t-online.de> Gesendet: Donnerstag, 15. Februar 2018 15:01:21 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Need help with string handling in mkgmap Hi, i'm struggling with the following problem and until now, i didn't find a solution. It seems, that in osm sometimes the height or elevation tag is filled with the unit sign, i.e 'm' and sometimes not. So with my current point file i either get elevation without the unit letter or with double unit letter - i.e 'Mm'. How to handle this ? I tried with this height=* { set mkgmap:height='${height|subst:"m=>"}'} ele=* { set mkgmap:ele='${ele|subst:"m=>"}'} but it doesn't work -- Mit freundlichen Grüßen ##################################################### Manfred Haiduk, Zum Fischbach 9, 52393 Hürtgenwald e-mail mhaiduk@t-online.de ##################################################### _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Manfred, I've just noticed that you set tags mkgmap:height and mkgmap:ele . This looks strange. They are not used in mkgmap and therefore I think you should not use the mkgmap: prefix. Or maybe you expect something special by using this prefix? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Manfred Haiduk <mhaiduk@t-online.de> Gesendet: Donnerstag, 15. Februar 2018 15:01:21 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Need help with string handling in mkgmap Hi, i'm struggling with the following problem and until now, i didn't find a solution. It seems, that in osm sometimes the height or elevation tag is filled with the unit sign, i.e 'm' and sometimes not. So with my current point file i either get elevation without the unit letter or with double unit letter - i.e 'Mm'. How to handle this ? I tried with this height=* { set mkgmap:height='${height|subst:"m=>"}'} ele=* { set mkgmap:ele='${ele|subst:"m=>"}'} but it doesn't work -- Mit freundlichen Grüßen ##################################################### Manfred Haiduk, Zum Fischbach 9, 52393 Hürtgenwald e-mail mhaiduk@t-online.de ##################################################### _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

If you look at my screenshot, you will see the left power turbines will be shown as "Senvion (153 Mm)" whilst the right power turbines will be shown as "Senvion (143m)". So it seems to me, that there is no really guide line how to put in the value of height or elevation in the osm map. And i simply want to get rid of the letter "M", to have shown all values in the same way. And i thought as it was suggested in the style manual on page 15, use the substitution filter "subst" to delete the letter "m", which is a part of the value for height or elevation. From the manual i was not sure of the correct syntax ... I will use your other hint with the conv filter and see, what will be the result from this. Am 15.02.2018 um 15:30 schrieb Gerd Petermann:
Hi Manfred,
I've just noticed that you set tags mkgmap:height and mkgmap:ele . This looks strange. They are not used in mkgmap and therefore I think you should not use the mkgmap: prefix. Or maybe you expect something special by using this prefix?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Manfred Haiduk <mhaiduk@t-online.de> Gesendet: Donnerstag, 15. Februar 2018 15:01:21 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Need help with string handling in mkgmap
Hi, i'm struggling with the following problem and until now, i didn't find a solution. It seems, that in osm sometimes the height or elevation tag is filled with the unit sign, i.e 'm' and sometimes not. So with my current point file i either get elevation without the unit letter or with double unit letter - i.e 'Mm'. How to handle this ?
I tried with this
height=* { set mkgmap:height='${height|subst:"m=>"}'} ele=* { set mkgmap:ele='${ele|subst:"m=>"}'}
but it doesn't work
--
Mit freundlichen Grüßen
##################################################### Manfred Haiduk, Zum Fischbach 9, 52393 Hürtgenwald e-mail mhaiduk@t-online.de #####################################################
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Mit freundlichen Grüßen ##################################################### Manfred Haiduk, Zum Fischbach 9, 52393 Hürtgenwald e-mail mhaiduk@t-online.de #####################################################

Hi Manfred,
So it seems to me, that there is no really guide line how to put in the value of height or elevation in the osm map.
Actually there is, exactly like you see in default style. This is a format for objects that support elevation, like for example peaks or contour lines. For these object elevation is saved in feet, but users can change elevation units in GPS. This means also, that format of displayed elevation value is predefined by GPS. There is a filter "height" designed to create elevation for these objects. If you prefer your own way to deal with elevation, you simply have to insert numbers to object name. You can modify name with many filters, probably filter "conv" should do what you need. But it won't support unknown units, like 'M'. This looks like an error in OSM data. -- Best regards, Andrzej
participants (3)
-
Andrzej Popowski
-
Gerd Petermann
-
Manfred Haiduk