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

Add measurement field type #15

Open
1ec5 opened this issue Oct 25, 2021 · 5 comments
Open

Add measurement field type #15

1ec5 opened this issue Oct 25, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@1ec5
Copy link

1ec5 commented Oct 25, 2021

iD’s implementations of the roadheight and roadspeed field types share a lot in common. Meanwhile, other fields would benefit from unit dropdowns too but would need a different set of units, for example the Max Weight field: openstreetmap/iD#6707. This category has more examples of measurement-typed keys. We should replace the roadheight and roadspeed field types with a more general measurement field type, along with a dimension property that can be set to one of several values like area and duration.

For dimension naming ideas, this CLDR file lists industry-recognized measure units, each of which starts with a category subtag.

@1ec5
Copy link
Author

1ec5 commented Nov 17, 2021

As of openstreetmap/iD#8769, number fields apply localized number formatting, which is generally a user-friendly change from before. However, some fields commonly require the unit to be specified explicitly, which prevents iD from applying this formatting. As long as some numeric fields are localized and others are not, users could easily get confused.

Here are some existing fields that commonly require the unit to be explicitly indicated:

  • charge
  • circumference
  • diameter
  • generator:output:electricity
  • plant:output:electricity

Here are some existing fields that have an implied metric unit, which presents a usability challenge to users in the United States and to some extent the United Kingdom. A dedicated measurement field type would enable iD to present a field that accepts values in customary or imperial units (and converts them behind the scenes if these units aren’t acceptable in OSM):

  • ele: “Elevation (Meters)”
  • capacity: “Capacity (Cubic Meters)”
  • min_height: “Height of bottom (Meters)”
  • volume: “Volume (Liters)”

@1ec5
Copy link
Author

1ec5 commented Jan 6, 2022

Possible values to allow in dimension based on the Unicode standard:

OpenStreetMap Unicode/CLDR
dimension usage
Distance over land (distance) length road
Distance over sea (seamark:light:range) length
Flow rate (flow_rate)
Frequency (frequency) frequency
Height (ele, maxheight) length vehicle
Incline (incline)

angle1

Length (width) length vehicle
Length, small-scale (gauge) length
Power (generator:output:electricity) power default
Pressure (pressure) pressure default
Range (siren:range) length visiblty
Speed (maxspeed) speed default
Weight (maxweight) mass default
Voltage (voltage)

Looking at the CLDR unit preference data, I wonder if it makes more sense for iD to store the regional unit preferences directly instead of getting them from country-coder. It seems like a JSON port of the LDML unit preference format would have much less overhead.

Footnotes

  1. OSM allows different angle units than CLDR.

@tyrasd
Copy link
Collaborator

tyrasd commented Jan 7, 2022

For some tags (e.g. capacity for man_made=storage_tank), there exist an implicit unit (e.g. cubic meters) but other measurement types are allowed as well (e.g. weights in t or kg).

@1ec5
Copy link
Author

1ec5 commented Nov 25, 2022

Some fields such as Max Stay (maxstay) express durations, which could also benefit from this field type or a dedicated duration field type.

/ref openstreetmap/iD#9387

@tordans
Copy link
Collaborator

tordans commented Jun 5, 2024

Copying openstreetmap/id-tagging-schema#1234 (comment) here so we don't forget

When we get around to implementing a measurement field type for ideditor/schema-builder#15, one wrinkle will be that helipads in the United States are rated in (thousands of) pounds rather than short tons, and this is what’s visible in aerial imagery. iD will need to add lbs as a third unit option alongside st and kg. We should do this for mass measurements anyways, since weight limits on roads in some U.S. states are posted exclusively in pounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants