Modify

Opened 5 years ago

Closed 5 weeks ago

Last modified 2 weeks 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 8 weeks ago.
patch for the preset part
josm_11253_validator.patch (2.2 KB) - added by skyper 8 weeks ago.
validator patch
josm_11253_preset_v2.patch (1.3 KB) - added by skyper 8 weeks ago.
preset patch v2
josm_11253_preset_v3.patch (1.5 KB) - added by skyper 6 weeks ago.
preset part with display_values
josm_11253_preset_v4.patch (1.3 KB) - added by skyper 6 weeks ago.
with values_no_i18n="true" and plural unit for 1.5

Download all attachments as: .zip

Change History (24)

comment:1 Changed 4 months ago by Klumbumbus

Component: CoreInternal preset
Priority: trivialnormal

comment:2 Changed 2 months ago by skyper

Keywords: maxstay unit added

And a Validator warning for values without units.

comment:3 Changed 8 weeks ago by skyper

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

Changed 8 weeks ago by skyper

Attachment: josm_11253_preset.patch added

patch for the preset part

Changed 8 weeks ago by skyper

Attachment: josm_11253_validator.patch added

validator patch

comment:4 Changed 8 weeks ago by skyper

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 Changed 8 weeks ago by skyper

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 Changed 8 weeks ago by Klumbumbus

Milestone: 20.04

Changed 8 weeks ago by skyper

Attachment: josm_11253_preset_v2.patch added

preset patch v2

comment:7 Changed 6 weeks ago by simon04

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 Changed 6 weeks ago by simon04

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?

comment:9 in reply to:  8 ; Changed 6 weeks ago by 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" ?

  • is it 1.5 year or 1.5 years?

Any native speaker around ?

Last edited 6 weeks ago by skyper (previous) (diff)

comment:10 in reply to:  9 ; Changed 6 weeks ago by 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.

Changed 6 weeks ago by skyper

Attachment: josm_11253_preset_v3.patch added

preset part with display_values

comment:11 Changed 6 weeks ago by skyper

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?

comment:12 in reply to:  10 ; Changed 6 weeks ago by Klumbumbus

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 Changed 6 weeks ago by Klumbumbus

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

Changed 6 weeks ago by skyper

Attachment: josm_11253_preset_v4.patch added

with values_no_i18n="true" and plural unit for 1.5

comment:14 Changed 6 weeks ago by skyper

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.

comment:15 in reply to:  12 Changed 6 weeks ago by skyper

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.

comment:16 in reply to:  14 Changed 5 weeks ago by simon04

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 weeks ago by simon04 (previous) (diff)

comment:17 Changed 5 weeks ago by Klumbumbus

Owner: changed from team to Klumbumbus

comment:18 Changed 5 weeks ago by Klumbumbus

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 Changed 2 weeks ago by Klumbumbus

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.