Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imperial units silently removed from ele tag #5658

Open
SK53 opened this issue Dec 27, 2018 · 7 comments · May be fixed by openstreetmap/id-tagging-schema#1216
Open

imperial units silently removed from ele tag #5658

SK53 opened this issue Dec 27, 2018 · 7 comments · May be fixed by openstreetmap/id-tagging-schema#1216
Labels
bug A bug - let's fix this! field An issue with a field in the user interface

Comments

@SK53
Copy link

SK53 commented Dec 27, 2018

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.

@bhousel
Copy link
Member

bhousel commented Dec 27, 2018

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.

@bhousel bhousel added bug A bug - let's fix this! field An issue with a field in the user interface labels Dec 27, 2018
@boothym
Copy link
Contributor

boothym commented Dec 27, 2018

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":
osm

@systemed
Copy link
Collaborator

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.

@bhousel
Copy link
Member

bhousel commented Dec 28, 2018

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

@1ec5
Copy link
Collaborator

1ec5 commented Nov 28, 2021

The ele key dates back to a simpler time when a lot of people thought the 123 unit format would be too unstructured for data consumers to be willing to parse. But that was before a whole host of keys started expecting that format, not to mention ref on ways and mini languages like opening_hours and turn:lanes. As things stand, ele stands out as a rare key that doesn’t accept units. I think that should change, but there should be some wider discussion so that data consumers aren’t caught unawares. It’s entirely possible that some renderers have implemented the same number parsing as iD and would misleadingly interpret 561 ft as 561 meters.

ideditor/schema-builder#15 requests a new field type for measured values, so that the Elevation field could display a dropdown menu for selecting meters or feet-and-inches.

@1ec5
Copy link
Collaborator

1ec5 commented Dec 3, 2021

As things stand, ele stands out as a rare key that doesn’t accept units. I think that should change, but there should be some wider discussion so that data consumers aren’t caught unawares.

https://wiki.openstreetmap.org/wiki/Proposed_features/ele_with_units

@1ec5
Copy link
Collaborator

1ec5 commented Jan 6, 2022

“(Meters)” was appended to the field name in openstreetmap/id-tagging-schema#95, which may decrease the likelihood of a user accidentally running into this trap, but regardless the field remains somewhat unintuitive in the United States.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this! field An issue with a field in the user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants