﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
23702	mapcss: add unit conversion for length values	skyper	team	"A first step was added in r19089, see [ticket:23621#comment:13]:

Copied from [ticket:23621#comment:15]:
> First impressions seems to be good, but I'm a bit puzzled on some things and have some questions on other things:
> 
> 1) why does it return `-` on invalid inputs? This makes it fairly prone to errors like:
> {{{#!rule
> node[height ^= ""-""] {
>   throwError: tr(""Surprisingly low value of {0} m"", to_float(siunit_length(tag(height))));
> }
> }}}
> which crashes JOSM if validating an object with height=-1 (or gives a bad message if to_float is omitted, just included it here to showcase a worst case scenario). Why not returning `null` or so? The example mapcss is hypothetically by the way, not a suggestion :)
> 
> 2) why not supporting negative numbers? For validation purposes, this makes a lot of sense, for instance the key `ele` has a lot of negative values.
> 
> 3) as it's a conversion, wouldn't `to_SIunit_length` or so be a better name than `siunit_length`?
> 
> 4) probably it should also support `km` and `nmi` as they're explicitly listed on the [https://wiki.openstreetmap.org/wiki/Map_features/Units wiki]. Even though they're the defaults and could hypothetically be omitted, some people do include them :)
> 
> 5) as it's always a Double, why not return it as a Double instead of a String 0:) ?
> 
> Bumping the priority a bit since it's almost release day with this new function :)
"	enhancement	closed	normal	24.05	Core		fixed	mapcss unit conversion lenght	taylor.smock
