Open 1ec5 opened 3 years ago
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)”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 ) |
`angle`[^angle] | — |
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.
[^angle]: OSM allows different angle units than CLDR.
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
).
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
Copying https://github.com/openstreetmap/id-tagging-schema/pull/1234#issuecomment-2131069853 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 addlbs
as a third unit option alongsidest
andkg
. We should do this for mass measurements anyways, since weight limits on roads in some U.S. states are posted exclusively in pounds.
iD’s implementations of the
roadheight
androadspeed
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 theroadheight
androadspeed
field types with a more generalmeasurement
field type, along with adimension
property that can be set to one of several values likearea
andduration
.For dimension naming ideas, this CLDR file lists industry-recognized measure units, each of which starts with a category subtag.