Modify

Opened 3 years ago

Last modified 6 weeks ago

#21930 new defect

[PATCH] Support new conditional parking lane tagging in validator

Reported by: riiga_92@… Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: template_report conditional parking Cc: wilfried.roemer@…, vindrg@…, mrgenie

Description

What steps will reproduce the problem?

  1. Add, for example, the tag "parking:condition:both:conditional=no_parking @ (Mo-Fr 08:00-18:00)" to a road.
  2. Run validator (or attempt to upload changes).

What is the expected result?

Tagging is valid and no warnings are raised.

What happens instead?

Warnings are given for valid tagging.

Please provide any additional information below. Attach a screenshot if possible.

I've made a possible patch, but I lack the ability to test it as I don't have a development environment for JOSM set up.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2022-01-02 21:24:43 +0100 (Sun, 02 Jan 2022)
Revision:18360
Build-Date:2022-01-02 20:26:19
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18360 en) Linux Manjaro Linux
Memory Usage: 938 MB / 4002 MB (203 MB allocated, but free)
Java version: 17.0.3+3, N/A, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1920×1200 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1200
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: sv_SE.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_SE
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: KDE
VM arguments: [--add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, -Djosm.restart=true, -Dawt.useSystemAAFontSettings=gasp]

Plugins:
+ AddrInterpolation (35893)
+ FastDraw (35893)
+ ImportImagePlugin (35893)
+ OpeningHoursEditor (35893)
+ PicLayer (1.0.1)
+ apache-commons (35893)
+ apache-http (35893)
+ areaselector (368)
+ austriaaddresshelper (1597341117)
+ buildings_tools (35893)
+ ejml (35893)
+ geotools (35893)
+ imagery_offset_db (35893)
+ jaxb (35893)
+ jna (35893)
+ jogl (1.2.3)
+ jts (35893)
+ kendzi3d-resources (0.0.2)
+ log4j (35893)
+ measurement (35893)
+ opendata (35893)
+ pt_assistant (1ff2e15)
+ reverter (35893)
+ tageditor (35893)
+ terracer (35893)
+ turnlanes-tagging (v0.0.5)
+ turnrestrictions (35893)
+ utilsplugin2 (35893)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/PublicTransportOneClick&zip=1
+ ${HOME}/Dokument/QuickSets.zip
+ https://github.com/kendzi/Simple3dBuildingsPreset/releases/download/0.9_2018-05-08/s3db-preset.zip
+ https://josm.openstreetmap.de/josmfile?page=Presets/ParkingLanes&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Fixme&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Surface-DataEntry&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_buildings_sv&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Enhanced_Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/PriorityRoad&zip=1
- ${HOME}/sidewalks-mod.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/SimpleBuildingTags&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SimpleRoofTags&zip=1
- https://raw.githubusercontent.com/yopaseopor/indoormap/master/indoormap-style.mapcss
- https://github.com/GlassOceanos/indoor-JOSM-style/archive/master.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/SidewalksAndFootways&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Postcode&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Admin_Boundaries&zip=1
- https://raw.githubusercontent.com/species/josm-preset-traffic_sign_direction/master/direction.mapcss
- ${HOME}/Dokument/OSM/Styles_ParkingLanes-style.mapcss

Last errors/warnings:
- 04250.842 E: Failed to locate image 'images/warning-flipped.svg'
- 04250.843 E: Failed to locate image 'images/warning.svg'
- 04250.843 E: Failed to locate image 'images/warning.svg'
- 04250.892 E: Failed to locate image 'images/warning-flipped.svg'
- 04250.893 E: Failed to locate image 'images/warning.svg'
- 04250.893 E: Failed to locate image 'images/warning.svg'
- 04252.495 E: Failed to locate image 'images/warning-flipped.svg'
- 04252.496 E: Failed to locate image 'images/warning.svg'
- 04252.784 E: Failed to locate image 'images/warning-flipped.svg'
- 04252.784 E: Failed to locate image 'images/warning.svg'

Attachments (7)

ConditionalKeys.diff (1.7 KB ) - added by riiga_92@… 3 years ago.
Possible patch
Screenshot_20220312_182746.png (203.5 KB ) - added by riiga_92@… 3 years ago.
JOSM validator warning
ConditionalKeys.2.diff (1.7 KB ) - added by riiga_92@… 3 years ago.
Correct diff (hopefully)
progress.diff (1.9 KB ) - added by riiga_92@… 3 years ago.
Progress in existing files
ParkingLanesConditional.java (10.2 KB ) - added by riiga_92@… 3 years ago.
New test
ParkingLanesConditionalTest.java (5.1 KB ) - added by riiga_92@… 3 years ago.
New unit test
street-parking-keys-with-conditional.diff (13.3 KB ) - added by pixunil 21 months ago.
Patch for validating parking:[SIDE]:[RESTRICTION]:conditional

Download all attachments as: .zip

Change History (27)

by riiga_92@…, 3 years ago

Attachment: ConditionalKeys.diff added

Possible patch

by riiga_92@…, 3 years ago

JOSM validator warning

comment:1 by riiga_92@…, 3 years ago

Seems like I made the patch the wrong around. What's being deleted should be added and vice versa.

by riiga_92@…, 3 years ago

Attachment: ConditionalKeys.2.diff added

Correct diff (hopefully)

comment:2 by skyper, 3 years ago

With all these new values only valid for parking:lane:* or parking:condition:* a separate test with own arrays might be better. Additionally, I think that there are keys missing like parking:lane:both:conditional.

comment:3 by riiga_92@…, 3 years ago

You're right that a separate test might be better. I will see if I can try and write one in the coming weeks.

parking:lane:both:conditional is not a valid key, a physical parking lane cannot be conditional.

in reply to:  3 ; comment:4 by skyper, 3 years ago

Replying to riiga_92@…:

parking:lane:both:conditional is not a valid key, a physical parking lane cannot be conditional.

Oh sorry, after the last changes it would be parking:lane:[SIDE]:[TYPE]:conditional if the position on the street changes.

comment:5 by taylor.smock, 3 years ago

Ticket #21924 has been marked as a duplicate of this ticket.

comment:6 by taylor.smock, 3 years ago

Cc: wilfried.roemer@… added

comment:7 by taylor.smock, 3 years ago

Summary: [PATCH] Support new conditional parking lane tagging in validator[WIP PATCH] Support new conditional parking lane tagging in validator

@riiga_92: Are you still working on this patch?

Also, I kind of feel like the parking:lane:[SIDE]:[TYPE]:conditional should be done in a for loop, e.g.

private static void addSubKeyConditionalRestrictions() {
    for (String side : Arrays.asList("left", "right", "both")) {
        RESTRICTION_TYPES.add("parking:condition:" + side);
        RESTRICTION_TYPES.add("parking:condition:" + side + ":maxstay");
    }
}

but having explicit types is OK right now. If it expands to have more subkey types (i.e., "lanes:conditional"), then I'll have a stronger opinion on it.

As a clarification, you said parking:lane:both:conditional is not a valid key, a physical parking lane cannot be conditional. Are you certain about that? Example:
highway=residential + parking:lane:both=parallel + parking:lane:both:parallel=on_street (on_street is defined as Parking on the street, which could be easily converted to a travel lane. ) + parking:lane:both:conditional=no @ 08:00-17:00 + lanes=2 + lanes:conditional=4 @ 08:00-17:00.

I probably borked the lanes:conditional, but I didn't see anything on the wiki for it.

Last edited 3 years ago by taylor.smock (previous) (diff)

comment:8 by riiga_92@…, 3 years ago

Not at the moment, I had some other stuff occupy my free time, but I might revisit this patch in the future. I'll add my progress so far. There are still some FIXMEs in the code.

Regarding :conditional on a physical parking lane, I am pretty certain since I was the one who wrote the proposal that was approved, though theoretically you could use that syntax, there's nothing that forbids it, but I didn't have that in mind. Does that type of parking lane exist in real life? If so, perhaps it would make sense to support it.

by riiga_92@…, 3 years ago

Attachment: progress.diff added

Progress in existing files

by riiga_92@…, 3 years ago

New test

by riiga_92@…, 3 years ago

New unit test

in reply to:  8 comment:9 by taylor.smock, 3 years ago

Replying to riiga_92@…:

Regarding :conditional on a physical parking lane, I am pretty certain since I was the one who wrote the proposal that was approved, though theoretically you could use that syntax, there's nothing that forbids it, but I didn't have that in mind. Does that type of parking lane exist in real life? If so, perhaps it would make sense to support it.

I think I have seen that somewhere, but for the life of me I cannot recall where.

comment:10 by skyper, 2 years ago

Ticket #22923 has been marked as a duplicate of this ticket.

in reply to:  4 comment:11 by skyper, 2 years ago

Cc: vindrg@… added
Keywords: conditional parking added

Replying to skyper:

Replying to riiga_92@…:

parking:lane:both:conditional is not a valid key, a physical parking lane cannot be conditional.

Oh sorry, after the last changes it would be parking:lane:[SIDE]:[TYPE]:conditional if the position on the street changes.

With the last accepted proposal :lane was dropped and it is now parking:[SIDE]:[TYPE]:conditional

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

by pixunil, 21 months ago

Patch for validating parking:[SIDE]:[RESTRICTION]:conditional

comment:12 by pixunil, 21 months ago

Summary: [WIP PATCH] Support new conditional parking lane tagging in validator[PATCH] Support new conditional parking lane tagging in validator

Hello,
I ran into the false warnings of for parking:[SIDE]:[TYPE]:conditional and added those tags to ConditionalKeys.java. Some remarks:

  • I do not know what the normal policy in JOSM for deprecated tagging is, but I excluded parking:lane:* and parking:condition:* from the patch and only included the accepted Street parking.
  • There were modes with a colon which effectively don't get matched (like ski:alpine). I added those as tests that keys like ski:alpine:conditional are deemed valid.
  • Some of the parking restriction keys also contain a colon (like parking:[SIDE]:restriction:reason:conditional. As this made parsing really hard by operating on chunks of key parts splitted by colon, I used a map to store all known keys to be valid. Normally I try to make changes to be small, but I couldn't find another way.
  • I added the check for access values for parking:[SIDE]:[MODE]:conditional, like currently for [MODE]:conditional. However, I noticed that when validating [MODE] (not conditional) with an invalid value, only a INFO is raised (Value ''some invalid value'' for key ''bicycle'' not in presets.), so maybe it would be better in future to delegate the value validation to TagChecker.
  • For the ease of my development, I changed the unit tests to be @ParameterizedTests. Later I noticed that the overhead per test is quite high (~ 300ms, which quickly adds up to 10s). As I do not understand the test set up, I need either information how to pay the overhead only once or else I could revert to methods full of assertions.
  • The patch does not include *:lanes:[DIRECTION]:conditional, but I know that this is also a false negative. However, I wanted to keep the patch small, because the change could be a bit controversial.

As this is my first patch contribution, please let me know if anything is missing / unclear.

comment:13 by skyper, 14 months ago

Ticket #23075 has been marked as a duplicate of this ticket.

comment:14 by skyper, 14 months ago

Type: enhancementdefect

As the current warnings are wrong, this is a defect.
See also https://community.openstreetmap.org/t/111690

comment:15 by skyper, 14 months ago

Cc: mrgenie added

comment:16 by gaben, 4 months ago

Summary: [PATCH] Support new conditional parking lane tagging in validator[WIP PATCH] Support new conditional parking lane tagging in validator

I've just tested the proposed patch, and I'm getting a warning to a way tagged with parking:condition:both:conditional=no_parking @ (Mo-Fr 08:00-18:00) on r19283.

comment:17 by gaben, 4 months ago

Summary: [WIP PATCH] Support new conditional parking lane tagging in validator[PATCH] Support new conditional parking lane tagging in validator

...which is fine, because that kind of tagging was deprecated in 2022, by the ticket author.

Old Key:parking:condition, new Street_parking.

@riiga_92, could you please actualize the ticket description?

comment:18 by riiga_92@…, 4 months ago

@gaben: How? I can't find any way to edit the description field.

comment:19 by gaben, 4 months ago

Just above the text input field where you type the comment, there is an openable menu, you'll se everything what is needed.

comment:20 by francians, 6 weeks ago

Hello,

please ensure that also:

parking:right:restriction:conditional=no_stopping @ (Fr[2] 05:00-08:00)

is considered correct from the validator.
For reference it is the second Friday of every month.
Thanks
Best Regards
francians

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to riiga_92@….
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


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