Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years 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 6 years 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 6 years ago.
Code deduplication (new function parseUrlTagsToKeyValues)
18038.3.patch (4.5 KB ) - added by taylor.smock 6 years 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 6 years ago.
Use streams for the entire operation of parsing url tags. And fix a typo (\\n -> \\|).
test.osm (465 bytes ) - added by taylor.smock 6 years ago.
Example osm file with changeset tags

Download all attachments as: .zip

Change History (17)

by taylor.smock, 6 years ago

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 by Don-vip, 6 years ago

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 by Don-vip, 6 years ago

Milestone: 19.08

by taylor.smock, 6 years ago

Attachment: 18038.2.patch added

Code deduplication (new function parseUrlTagsToKeyValues)

by taylor.smock, 6 years ago

Attachment: 18038.3.patch added

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

comment:3 by taylor.smock, 6 years ago

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

by taylor.smock, 6 years ago

Attachment: 18038.4.patch added

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

comment:4 by taylor.smock, 6 years ago

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 by Don-vip, 6 years ago

Resolution: fixed
Status: newclosed

In 15316/josm:

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

comment:6 by Don-vip, 6 years ago

Thanks!

comment:7 by Don-vip, 6 years ago

In 15319/josm:

see #18038 - checkstyle

comment:8 by Klumbumbus, 6 years ago

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

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

Replying to Klumbumbus:

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

OK, that wiki page has been updated.

comment:10 by Klumbumbus, 6 years ago

Thanks.

comment:11 by StefanB, 6 years ago

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

by taylor.smock, 6 years ago

Attachment: test.osm added

Example osm file with changeset tags

in reply to:  11 comment:12 by taylor.smock, 6 years ago

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. 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.