Modify

Opened 10 years ago

Closed 5 years ago

Last modified 5 years ago

#11253 closed defect (fixed)

[Patch] Parkings and maxstay: no unit for the maxstay-time

Reported by: anonymous Owned by: Klumbumbus
Priority: normal Milestone: 20.05
Component: Internal preset Version: tested
Keywords: template_report maxstay unit Cc:

Description (last modified by skyper)

What steps will reproduce the problem?

Select a random car parking and add a "maxstay"-time using the dialogue:

Select the maxstay-time in minutes (0, 30, 60, ...) from the drop-down-menu, and a "maxstay"-key/value-pair is added to the parking object. Everything works ok here.

What is the expected result?

According to the OSM wiki article on the "maxstay"-key (osmwiki:Key:maxstay) and the previous discussion (osmwiki:Proposed_features/Maximum_Stay) it seems necessary to add a unit of time (minute(s), hour(s), day(s)) after the numeric value.

Example: the key/value-pair of a maxstay of 120 minutes should be "maxstay=120 minutes", but...

What happens instead?

... JOSM omits the time unit and writes only "maxstay=120" although the dialogue advises to enter the time in minutes.

Perhaps, if accepted as a bug, this might also be a candidate for the built-in check and validator functions...

Revision: 8109
Repository Root: http://josm.openstreetmap.de/svn
Relative URL: ^/trunk
Last Changed Author: Don-vip
Last Changed Date: 2015-03-02 00:13:51 +0100 (Mon, 02 Mar 2015)
Build-Date: 2015-03-02 02:30:58
URL: http://josm.openstreetmap.de/svn/trunk
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last Changed Rev: 8109

Identification: JOSM/1.5 (8109 de) Windows 7 64-Bit
Memory Usage: 123 MB / 989 MB (55 MB allocated, but free)
Java version: 1.8.0_31, Oracle Corporation, Java HotSpot(TM) Client VM
Dataset consistency test: No problems found

Plugins:
- FixAddresses (30892)
- HouseNumberTaggingTool (30892)
- OpeningHoursEditor (30962)
- RoadSigns (30977)
- buildings_tools (30955)
- imagery_offset_db (30892)
- namemanager (30892)
- public_transport (30892)
- reverter (30990)
- tageditor (30892)
- terracer (30892)
- turnlanes (30892)
- turnrestrictions (31034)

Last errors/warnings:
- E: java.io.IOException: No file found for: http://josm.openstreetmap.de/josmfile?page=Styles/PublicTransportation&style
- E: Fehler beim Laden des Bildes 'error_small.png'
- W: Mappaint style "standard" (FIXME Highlight Warnings) icon "error_small.png" not found.
- E: Fehler beim Laden des Bildes 'maxspeed_icon.svg'
- W: Mappaint style "standard" (Höchstgeschwindigkeit) icon "maxspeed_icon.svg" not found.

Attachments (5)

josm_11253_preset.patch (870 bytes ) - added by skyper 5 years ago.
patch for the preset part
josm_11253_validator.patch (2.2 KB ) - added by skyper 5 years ago.
validator patch
josm_11253_preset_v2.patch (1.3 KB ) - added by skyper 5 years ago.
preset patch v2
josm_11253_preset_v3.patch (1.5 KB ) - added by skyper 5 years ago.
preset part with display_values
josm_11253_preset_v4.patch (1.3 KB ) - added by skyper 5 years ago.
with values_no_i18n="true" and plural unit for 1.5

Download all attachments as: .zip

Change History (24)

comment:1 by Klumbumbus, 5 years ago

Component: CoreInternal preset
Priority: trivialnormal

comment:2 by skyper, 5 years ago

Keywords: maxstay unit added

And a Validator warning for values without units.

comment:3 by skyper, 5 years ago

Added a patch for the preset part. Sorry, have to get used to validator syntax, again, to deliver the more complicated part: the validator tests and autofixes

by skyper, 5 years ago

Attachment: josm_11253_preset.patch added

patch for the preset part

by skyper, 5 years ago

Attachment: josm_11253_validator.patch added

validator patch

comment:4 by skyper, 5 years ago

I updated the preset patch and added the validator part, see josm_11253_preset_v2.patch and josm_11253_validator.patch. Hope it is ok in two separate files. Please, recheck, especially the validator part, as I am not that familiar with the mapcss, yet.

I was unsure about the values no and unlimited but 0 is even worse.

comment:5 by skyper, 5 years ago

Description: modified (diff)
Summary: Parkings and maxstay: no unit for the maxstay-time[Patch] Parkings and maxstay: no unit for the maxstay-time

comment:6 by Klumbumbus, 5 years ago

Milestone: 20.04

by skyper, 5 years ago

Attachment: josm_11253_preset_v2.patch added

preset patch v2

comment:7 by simon04, 5 years ago

Uff, the values (unit notations, to be more precise) in use are a mess – https://taginfo.openstreetmap.org/keys/maxstay#values

What a pity, since ISO 8601 defines a notation for durations, see https://en.wikipedia.org/wiki/ISO_8601#Durations

For example, P3Y6M4DT12H30M5S represents a duration of "three years, six months, four days, twelve hours, thirty minutes, and five seconds".

comment:8 by simon04, 5 years ago

Ad attachment:josm_11253_preset_v2.patch

  • we should also specify values_no_i18n="true" (to avoid exclude the strings from i18n)
  • is it 1.5 year or 1.5 years?

in reply to:  8 ; comment:9 by skyper, 5 years ago

Replying to simon04:

Ad attachment:josm_11253_preset_v2.patch

  • we should also specify values_no_i18n="true" (to avoid exclude the strings from i18n)

Good point but how do we handle "unlimited" ?

  • is it 1.5 year or 1.5 years?

Any native speaker around ?

Last edited 5 years ago by skyper (previous) (diff)

in reply to:  9 ; comment:10 by skyper, 5 years ago

Replying to skyper:

Replying to simon04:

Ad attachment:josm_11253_preset_v2.patch

  • we should also specify values_no_i18n="true" (to avoid exclude the strings from i18n)

Good point but how do we handle "unlimited" ?

Better we use display_values.

by skyper, 5 years ago

Attachment: josm_11253_preset_v3.patch added

preset part with display_values

comment:11 by skyper, 5 years ago

I've added display_values in josm_11253_preset_v3.patch​ but I am not sure about plural or singular form of units for values below 2. Is it 1.5 hour or 1.5 hours?

in reply to:  10 ; comment:12 by Klumbumbus, 5 years ago

Replying to skyper:

Replying to skyper:

Replying to simon04:

Ad attachment:josm_11253_preset_v2.patch

  • we should also specify values_no_i18n="true" (to avoid exclude the strings from i18n)

Good point but how do we handle "unlimited" ?

Better we use display_values.

The question was if we use values_no_i18n="true" or not, because that will exclude all values or not. ("30 minutes" and similar, rather should be exluded, but "unlimited" or "no" rather not.) I don't see how display_values could help here.

I would go with values_no_i18n="true" because IIRC if you have e.g. in german "30 Minuten" in the combo and you manually change it to "45 Minuten", the value will be "45 Minuten", not "45 minutes", which would be bad.

comment:13 by Klumbumbus, 5 years ago

The wiki lists one example "maxstay= 1.5 hour", but I would say "1.5 hours" makes more sense, see also https://www.dict.cc/?s=anderthalb+Stunden and https://www.englishclub.com/tefl-forums/viewtopic.php?t=1584. Also more values are tagged as plural than as singular with 1.5 as search expression on https://taginfo.openstreetmap.org/keys/?key=maxstay#values

by skyper, 5 years ago

Attachment: josm_11253_preset_v4.patch added

with values_no_i18n="true" and plural unit for 1.5

comment:14 by skyper, 5 years ago

Ok, josm_11253_preset_v4.patch​​ with values_no_i18n="true" and correct plural form of unit.
Personally, I use the presets only to get auto-completion working and I use only English, so, I am far from being an expert.

The validator part could include autofixes for some common errors but I need some time to play with MapCSS first, to know what really is to do.

in reply to:  12 comment:15 by skyper, 5 years ago

Replying to Klumbumbus:

I would go with values_no_i18n="true" because IIRC if you have e.g. in german "30 Minuten" in the combo and you manually change it to "45 Minuten", the value will be "45 Minuten", not "45 minutes", which would be bad.

There seems to be room for an enhancement, e.g. show display_values in combo but always display values for editing.

in reply to:  14 comment:16 by simon04, 5 years ago

Replying to skyper:

The validator part could include autofixes for some common errors but I need some time to play with MapCSS first, to know what really is to do.

See source:trunk/resources/data/validator/numeric.mapcss for validation w.r.t. numbers and units.

Err, I overlooked attachment:josm_11253_validator.patch

Last edited 5 years ago by simon04 (previous) (diff)

comment:17 by Klumbumbus, 5 years ago

Owner: changed from team to Klumbumbus

comment:18 by Klumbumbus, 5 years ago

Resolution: fixed
Status: newclosed

In 16340/josm:

fix #11253 - require to add unit to maxstay tag, rework preset and add validator rules with autofixes for the most common cases (patch by skyper, modified)

comment:19 by Klumbumbus, 5 years ago

Milestone: 20.0420.05

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Klumbumbus.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.