Modify

Opened 2 months ago

Closed 8 weeks ago

Last modified 4 weeks ago

#18038 closed enhancement (fixed)

[PATCH] Arbitrary changeset tags should be able to be added via remote control

Reported by: taylor.smock Owned by: team
Priority: normal Milestone: 19.08
Component: Core remotecontrol Version:
Keywords: changeset tag Cc:

Description

I'm specifically interested in being able to have "import=yes" added to the changeset tags.

The workflow I want to have is:

1) Download an area with JOSM using a tasking manager
2) Download an extract of data to import into JOSM (possibly using a tasking manager, if it supports it)
3) Use conflation to take data from the import data and copy it to the OSM data layer
4) Perform checks to make certain the data is OK
5) Upload the data (should have the import=yes tag, if at all possible here)

What I've tried:

  1. Making certain that there is a <changeset><tag k="import" v="yes"/></changeset> in the import data layer. Conflation doesn't copy the changeset information over to the OSM data layer.

This duplicates #9387 and #9472

Attachments (5)

18038.patch (2.0 KB) - added by taylor.smock 2 months ago.
Add changeset_tags to LoadAndZoomHandler, changeset_tags can be overriden with changeset_source (and other existing tags) in the current implementation
18038.2.patch (4.1 KB) - added by taylor.smock 8 weeks ago.
Code deduplication (new function parseUrlTagsToKeyValues)
18038.3.patch (4.5 KB) - added by taylor.smock 8 weeks ago.
Use streams for initial section (where we split a url section into key=value sections)
18038.4.patch (4.2 KB) - added by taylor.smock 8 weeks ago.
Use streams for the entire operation of parsing url tags. And fix a typo (\\n -> \\|).
test.osm (465 bytes) - added by taylor.smock 4 weeks ago.
Example osm file with changeset tags

Download all attachments as: .zip

Change History (17)

Changed 2 months ago by taylor.smock

Attachment: 18038.patch added

Add changeset_tags to LoadAndZoomHandler, changeset_tags can be overriden with changeset_source (and other existing tags) in the current implementation

comment:1 Changed 8 weeks ago by Don-vip

This can be rewritten to:

                    // This logic is (largely) stolen from the AddTagsDialog.
                    Set<String> tagSet = Arrays.stream(args.get("changeset_tags").split("\\|"))
                        .map(String::trim)
                        .filter(tag -> !tag.isEmpty() && tag.contains("="))
                        .collect(Collectors.toSet());

Could you please propose a refactoring where the code is shared between LoadAndZoomHandler and AddTagsDialog, instead of being copied/pasted?

comment:2 Changed 8 weeks ago by Don-vip

Milestone: 19.08

Changed 8 weeks ago by taylor.smock

Attachment: 18038.2.patch added

Code deduplication (new function parseUrlTagsToKeyValues)

Changed 8 weeks ago by taylor.smock

Attachment: 18038.3.patch added

Use streams for initial section (where we split a url section into key=value sections)

comment:3 Changed 8 weeks ago by taylor.smock

Summary: [PATCH] Arbitrary changeset tags should be able to be added via remote control[WIP PATCH] Arbitrary changeset tags should be able to be added via remote control

Changed 8 weeks ago by taylor.smock

Attachment: 18038.4.patch added

Use streams for the entire operation of parsing url tags. And fix a typo (\\n -> \\|).

comment:4 Changed 8 weeks ago by taylor.smock

Summary: [WIP PATCH] Arbitrary changeset tags should be able to be added via remote control[PATCH] Arbitrary changeset tags should be able to be added via remote control

comment:5 Changed 8 weeks ago by Don-vip

Resolution: fixed
Status: newclosed

In 15316/josm:

fix #18038 - Add arbitrary changeset tags via remote control (patch by taylor.smock)

comment:6 Changed 8 weeks ago by Don-vip

Thanks!

comment:7 Changed 8 weeks ago by Don-vip

In 15319/josm:

see #18038 - checkstyle

comment:8 Changed 7 weeks ago by Klumbumbus

@Taylor, could you please update wiki:/Help/RemoteControlCommands?

comment:9 in reply to:  8 Changed 7 weeks ago by taylor.smock

Replying to Klumbumbus:

@Taylor, could you please update wiki:/Help/RemoteControlCommands?

OK, that wiki page has been updated.

comment:10 Changed 7 weeks ago by Klumbumbus

Thanks.

comment:11 Changed 4 weeks ago by StefanB

Nice!
Could you add this also to the /import, pretty please? See #11310.

Changed 4 weeks ago by taylor.smock

Attachment: test.osm added

Example osm file with changeset tags

comment:12 in reply to:  11 Changed 4 weeks ago by taylor.smock

Replying to StefanB:

Nice!
Could you add this also to the /import, pretty please? See #11310.

I'll look into this, but I would need to decide what gets priority. The osm file being imported, or the URL. I personally would default to the osm file changeset tags.

For example, if the url is http://127.0.0.1:8111/import?changeset_tags=comment=SomeComment|source=SomeSource|import=yes&url=https://josm.openstreetmap.de/raw-attachment/ticket/18038/test.osm, the changeset tags from the test.osm file would take precedence.

I'll look into this when I have time, but I'd like to finish some other projects first (a validator test for sharp angles and a plugin for RapiD).

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.