I was adding a peak from old OOC maps which have all elevation data in feet. I therefore entered 561 ft in the elevation field, so was somewhat surprised to find it rendered as 561 m. Testing shows that iD silenty strips any non-numeric text (including ",") from what is entered. Although ele:imperial is probably the most widely used tag for non-metric units, the ele tag with an indication of units (e.g., ft, feet, or "'") has always been in use. I would expect at least a warning, because there is a big difference between 561 feet & metres.
Oh yeah, good catch @SK53
This is like #5438 / #5570
iD tries too hard to parse the numeric fields as numbers.
I think we probably need to take a first pass with a regex to decide whether the field is strictly numeric before trying to parse it.
Entering "561 ft" in the ele field is a tagging mistake. ele:imperial is used only once on the map - ele:ft is the more widely used tag (2k+).
It would be good if that could be picked up by iD - highlighting the field with a red border or similar if it's not strictly numeric. Basically input type="number" but without the browser's up/down controls, like the website field with type="url":
Entering "561 ft" in the ele field is a tagging mistake
Nope. Space-separated units have been used in OSM since time immemorial and most major clients parse them, such as osm2pgsql, mkgmap, OSRM, Graphhopper etc.
Right, regardless of whether it happens to be a "tagging mistake" in the "ele" field - this is something iD needs to support in all the numeric fields.
I've actually been thinking of adding a "default units" property to each field that can have such a thing. There are a lot of them. But right now we include the default unit in the field label _sometimes_, and in the placeholder _sometimes_, but none of this is done consistently, and I'm sure it makes a mess for translators.
https://github.com/openstreetmap/iD/blob/master/data/presets/fields/fire_hydrant/pressure.json
https://github.com/openstreetmap/iD/blob/master/data/presets/fields/generator/output/electricity.json
Most helpful comment
Right, regardless of whether it happens to be a "tagging mistake" in the "ele" field - this is something iD needs to support in all the numeric fields.
I've actually been thinking of adding a "default units" property to each field that can have such a thing. There are a lot of them. But right now we include the default unit in the field label _sometimes_, and in the placeholder _sometimes_, but none of this is done consistently, and I'm sure it makes a mess for translators.
https://github.com/openstreetmap/iD/blob/master/data/presets/fields/fire_hydrant/pressure.json
https://github.com/openstreetmap/iD/blob/master/data/presets/fields/generator/output/electricity.json