openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.37k stars 1.21k forks source link

Auto-complete of genus tag values are incorrectly cast to lowercase #3377

Closed SK53 closed 8 years ago

SK53 commented 8 years ago

A recent post on the tagging mailing list suggests that iD is automatically changing or auto-completing values of the key genus to lowercase values (see https://lists.openstreetmap.org/pipermail/tagging/2016-August/029889.html). A quick experiment shows that this is the case for autocompletion at least.

This is incorrect. Genus names must begin with a capital letter as they have since Linnaeus' day. The form of biological names are mandated by the ICZN & ICBN nomenclature codes. Technically a name in lowercase has not meaning.

This is non-trivial as when genus values are populated matching to external lists of valid generic names is the single best QA for these values, and particularly because people frequently add non-scientific names for genera in the field, such as oak, lime, ash.

This key should behave in exactly the same way as name, operator, architect, owner, etc.

Related keys species, taxon, taxon:*, dominant_taxon etc should also behave in the same way.

bhousel commented 8 years ago

This is in the raw tag editor value field, right? Can you send a screenshot?

SK53 commented 8 years ago

Yes exactly so. Example is when typing "Q" for "Quercus"

screenshot 17

1ec5 commented 8 years ago

The approach in #3280 may help – we just need to add genus to the list of tags that allows uppercase suggestions. The the root cause is that, when the first taginfo match happens to be lowercase, the entered text becomes lowercase too. At the application level, most autocompletion implementations either revert to the manually input case when rejecting the suggestion or keep the manually input case intact until the suggestion is accepted.

SK53 commented 8 years ago

This may be my ignorance, but I thought that iD took most popular values from taginfo. Quercus for instance out-numbers quercus by about 250-fold (10k+ vs. 39) and therefore ought to be the value presented for auto-completion.

bhousel commented 8 years ago

This may be my ignorance, but I thought that iD took most popular values from taginfo. Quercus for instance out-numbers quercus by about 250-fold (10k+ vs. 39) and therefore ought to be the value presented for auto-completion.

That's true, but we have special logic in taginfo.js to say that when multiple search results are returned that differ only in case, to keep only the lowercase one.

For most fields in OSM (cuisine, religion, denomination) it's the behavior we actually want.
e.g. prefer "french" instead of "French"... prefer "catholic" over "Catholic".

The taxonomy fields are the oddball ones, and need to be whitelisted like @1ec5 suggested - he's right because he just introduced similar logic for network.

SK53 commented 8 years ago

@bhousel Thanks for clarification, makes a great deal of sense.