Modify

Opened 2 years ago

Closed 12 months ago

Last modified 12 months ago

#21782 closed enhancement (fixed)

[patch] Deprecate vending=parcel_pickup

Reported by: overflorian Owned by: team
Priority: normal Milestone: 23.04
Component: Internal preset Version:
Keywords: vending vending_machine parcel Cc: Klumbumbus

Description (last modified by gaben)

Hi,
A new tag just has been approved: Tag:amenity=parcel_locker and describes a parcel locker.
It replaces previously used (and now deprecated) amenity=vending_machine + vending=parcel_pickup

I propose to:

  • While a amenity=vending_machine is created, stop proposing the associated preset vending=parcel_pickup
  • Create a new dedicated preset for amenity=parcel_locker
  • Change the validator accordingly

Thanks

PS: deprecation follow-up (including similar requests to other tools) is available on this wiki page: https://wiki.openstreetmap.org/wiki/Tag:vending%3Dparcel_pickup#Deprecation_follow-up

Attachments (5)

josm_21728_parcel_locker.patch (5.9 KB ) - added by gaben 2 years ago.
initial patch
josm_21728_parcel_locker_v2.patch (5.9 KB ) - added by gaben 2 years ago.
add missing commas, change mapcss rule
josm_21728_parcel_locker_v3.patch (6.4 KB ) - added by gaben 18 months ago.
josm_21728_parcel_locker_v4.patch (7.6 KB ) - added by gaben 18 months ago.
added amenity=vending_machine filter, remove deprecated vending values, remove amenity=parcel_locker from ignoretags.cfg
josm_21728_parcel_locker_v5.patch (7.6 KB ) - added by gaben 12 months ago.

Download all attachments as: .zip

Change History (41)

comment:1 by gaben, 2 years ago

Keywords: vending vending_machine parcel added
Type: defectenhancement

comment:2 by gaben, 2 years ago

A preset is already available for download, see Presets/ParcelLockers.

comment:3 by aceman, 2 years ago

Thanks, but that preset offers also undocumented tags like 'parcel_locker=', or mixes name and number into a single tag 'ref='.

Anyway, JOSM should have this built in, because the lockers are very popular in the wild. The real extent in OSM is unknown, as many have been tagged as amenity=vending_machine as that was the method at the time.

comment:4 by gaben, 2 years ago

The icon from the above preset would do it for JOSM?

comment:5 by gaben, 2 years ago

Summary: Deprecate vending=parcel_pickup[WIP patch] Deprecate vending=parcel_pickup

Please try out the provided patch.

The preset structure is not appealing for me, but this is the best I could came up with.

Edit: the icon is from the above preset (here), but slightly modified by me.

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

by gaben, 2 years ago

initial patch

by gaben, 2 years ago

add missing commas, change mapcss rule

comment:6 by gaben, 2 years ago

The messages still not working as one would expect, but it's JOSM's limitation. With regex, sublist and probably more, the {*.key} property cannot read out.

One possible solution is duplicating rules:

*[amenity=vending][vending=parcel_mail_in],
*[amenity=vending][vending=parcel_pickup],
*[amenity=vending][vending=parcel_mail_in;parcel_pickup],
*[amenity=vending][vending=parcel_pickup;parcel_mail_in] { ... }

but it isn't elegant ...and doesn't work. I'm out of ideas. Probably a new custom message is needed.

comment:7 by skyper, 2 years ago

Some remarks:

  • I guess the icon needs more colors/contrast. Only one color does not work well, regarding different LaFs and backgrounds.
  • The style should support areas and not only nodes.
  • The validator rule does not work so far, as parcel_mail_in and/or parcel_pickup need to be preserved as keys. Maybe, we need several rules for different cases.

comment:8 by gaben, 2 years ago

  • Yes, a white bg would do it, like the hunting stand's icon.
  • The wiki page was modified since then, allowing areas as well, thanks for noticing.
  • What do you mean? It is preserved by the patch, only ignoring vending=parcel_mail_in/parcel_pickup.

comment:9 by skyper, 2 years ago

  • A background might work, but actually I am not convinced about the icon and its recognition.
  • The wiki was wrong as prior use and the proposal included areas.
  • No, I would expect to add parcel_pickup=yes if the key is not present and vending=parcel_pickup is removed. Same for parcel_mail_in=*.

comment:10 by kubahaha, 20 months ago

How is it going? Since amenity=parcel_locker is added even to default carto style

comment:11 by gaben, 20 months ago

Description: modified (diff)

I've created the base patch, and looking at the wiki page we got a new icon since then.

@skyper can you work on this or should I proceed with the patch?

comment:12 by skyper, 20 months ago

@gaben:
Please, go ahead. I might have time to comment but I won't work on it.

comment:13 by gaben, 19 months ago

Okay, currently investigating why the {0.key} is not working with the ~= selector. To my understanding, it should work.

Last edited 19 months ago by gaben (previous) (diff)

comment:14 by gaben, 18 months ago

Summary: [WIP patch] Deprecate vending=parcel_pickup[patch] Deprecate vending=parcel_pickup

Please review, I think it's done.

in reply to:  13 comment:15 by skyper, 18 months ago

Yes, much better but:

  • the warnings should check for amenity=vending_machine
    • not sure if we need to check for existing parcel_pickup=* and parcel_mail_in=* before overwriting
  • vending=parcel_mail_in and vending=parcel_pickup should be removed from presets (was in v2 but is missing in v3)
  • rendering of the deprecated tags needs to be changed to deprecated.svg for nodes and disabled for areas
    • the old icon should probably be moved to nodist/

Replying to gaben:

Okay, currently investigating why the {0.key} is not working with the ~= selector. To my understanding, it should work.

As workaround you can add an additional selector [key] to get the key and/or its values.

comment:16 by gaben, 18 months ago

Thanks for the review!

  • I was thinking about adding the amenity=vending_machine to the filter, but I left it out intentionally. It does not harm, so readded.
  • Good catch! Probably a result of working locally (no git branch or commits) on 4 tickets in parallel. Fixed.
  • Hmm, I may miss something. The main tag amenity=vending_machine is still used. I checked all the deprecated.svg usages, and none of them was a combination of a main and subtag, like in our case (amenity=vending_machine + vending=parcel_pickup|parcel_mail_in).

comment:17 by skyper, 18 months ago

Thanks for re-adding amenity=vending_machine to the filter. It is important as without it other values of amenity=* would be overwritten by the fix.
Sorry, I was off regarding the rendering. Thought we have more individual icons but that is not the case. Anyway, I still think deprecated.svg for the combination is useful as eyes' catcher but not that important.

by gaben, 18 months ago

added amenity=vending_machine filter, remove deprecated vending values, remove amenity=parcel_locker from ignoretags.cfg

comment:18 by gaben, 18 months ago

Milestone: 22.11

Now it looks good, but not sure if ignoretags.cfg needs individual entries for tag values:

K:vending=parcel_pickup
K:vending=parcel_mail_in
K:vending=parcel_pickup;parcel_mail_in

So the question, is it missing K:vending=parcel_mail_in;parcel_pickup (switched order) or the first two is unnecessary?

Anyway, it's minor. Whoever will commit, please have a look at it.

Last edited 18 months ago by gaben (previous) (diff)

comment:19 by taylor.smock, 16 months ago

Milestone: 22.1122.12

Milestone renamed

comment:20 by taylor.smock, 16 months ago

Milestone: 22.1223.01

Ticket retargeted after milestone closed

comment:21 by taylor.smock, 15 months ago

Somewhat stupid question:
What is supposed to happen if something is tagged vending=parcel_pickup;parcel_mail_in;stamps?

As an aside, there is a list membership comparator, so instead of [vending="parcel_mail_in;parcel_pickup"] and [vending="parcel_pickup;parcel_mail_in"] you can do [vending~=parcel_mail_in][vending~=parcel_pickup]. If you do that, you will probably want to set .deprecated_parcel or something and use !.deprecated_parcel to avoid having multiple warnings for the same thing.

comment:22 by gaben, 15 months ago

Yes, there is the list membership comparator, although if I remember correctly, the problem is the fixAdd: "{0.value}=yes"; part is not working as mentioned in comment:6 and comment:13.

Probably it's a corner case, so not a bug, just no one thought about it yet.

comment:23 by gaben, 15 months ago

Cc: Klumbumbus added

Looping in Klumbumbus. What do you think about the provided patch? I couldn't find any other possibility.

comment:24 by taylor.smock, 15 months ago

I was thinking of something like the following (trimmed for size)

/* #21782 */
*[amenity=vending_machine][vending=parcel_mail_in],
*[amenity=vending_machine][vending=parcel_pickup] {
  set .parcel_checked;
  throwWarning: tr("{0} is deprecated", "{1.tag}");
  group: tr("deprecated tagging");
}
/** It would be nice if we could just say list type only has the following values */
*[amenity=vending_machine][vending~=parcel_mail_in][vending~=parcel_pickup][count(uniq_list(split(";", tag("vending")))) == 2] {
  set .parcel_checked;
  throwWarning: tr("{0} is deprecated", "{1.tag}");
  group: tr("deprecated tagging");
}
/** This is just for cases where we have stamp;parcel_mail_in or stuff like that */
*[amenity=vending_machine][vending~=parcel_mail_in]!.parcel_checked,
*[amenity=vending_machine][vending~=parcel_pickup]!.parcel_checked {
  throwWarning: tr("{0} is deprecated", "{1.tag}");
  group: tr("deprecated tagging");
}

comment:25 by taylor.smock, 15 months ago

Milestone: 23.0123.02

Ticket retargeted after milestone closed

comment:26 by taylor.smock, 14 months ago

Milestone: 23.0223.03

Ticket retargeted after milestone closed

comment:27 by taylor.smock, 13 months ago

Milestone: 23.0323.04

Ticket retargeted after milestone closed

comment:28 by taylor.smock, 12 months ago

Milestone: 23.04

Moving off of milestone.

comment:29 by gaben, 12 months ago

What else is required to commit?

comment:30 by taylor.smock, 12 months ago

My problem was that the last patch didn't cover stuff like vending=parcel_pickup;parcel_mail_in;stamps (comment:21).

comment:31 by gaben, 12 months ago

What about this one? I think it addresses all the issues, although ugly :)
Btw the vending=parcel_mail_in;stamps case produces two warnings still. We can probably ignore that as it's rare.

comment:32 by gaben, 12 months ago

@skyper what do you think?

@taylor, can it fit in April's release? I'm waiting for it since the original patch. Also the usage is increasing rapidly.

comment:33 by taylor.smock, 12 months ago

Resolution: fixed
Status: newclosed

In 18719/josm:

Fix #21782: Deprecate vending=parcel_pickup (patch by gaben, modified)

On 2022-01-03, the osmwiki:Proposed_features/amenity=parcel_locker was approved.
It specifically deprecated vending=parcel_pickup and vending_parcel_mail_in.

comment:34 by taylor.smock, 12 months ago

Milestone: 23.04

comment:35 by gaben, 12 months ago

Thank you! I had some issues with the group setting somehow. When I set the group, the autofix didn't work. Maybe I need to fix my dev env, it's a 3 years old VM.

in reply to:  35 comment:36 by taylor.smock, 12 months ago

Replying to gaben:

[...snip...] Maybe I need to fix my dev env, it's a 3 years old VM.

Maybe? You shouldn't need a dev VM though. You should be able to do dev work on Windows. I'm on macOS/Linux, but AFAIK there are no platform specific steps needed for setting up a development environment for JOSM. You just need a JDK (we are still targeting Java 8, but a competent IDE should let you set the language level if you install a newer JDK), a text editor (although you would probably prefer an IDE like Eclipse or IDEA), and ant, which I believe has Windows binaries available.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.