Modify

Opened 12 months ago

Last modified 4 months ago

#23481 new enhancement

add more flexibility when exporting a relation to a GPX layer or file

Reported by: cmuelle8 Owned by: team
Priority: minor Milestone:
Component: Core Version:
Keywords: Cc:

Description (last modified by cmuelle8)

This patch is a major overhaul of the GPX conversion feature offered for relations by the RelationList dialog.

The input data is searched for the roles assigned to relation list members.

If and only if more than one role (usually: more than the empty role) is found, a dialog with four options is shown on how to deal with relation roles during the export process, these are:

  • allow any role
  • user-select roles to be considered
  • allow preset-defined roles only
  • ignore roles / treat all as empty

Userselection is an expert feature, because it may give unexpected results. It allows deselection of e. g. forward / backward roles that the WayConnectionTypeCalculator depends on to resolve directional variants of a route. Excluding members having these roles will impact the WayConnectionTypeCalculator's decisions for the remaining members and in consequence split the members in a different manner than if it would see the full data. A tooltip is provided to raise awareness to this.

Preset-defined option will look up the defined roles for the specific relation type being exported and any member with an (preset-wise) undefined role will be discarded during export.

Ignore roles can, amongst other use cases, be used to export all relation members of an otherwise bidirectional route, bypassing the WayConnectionTypeCalculator. It is less intended to produce a clean GPX for travel directions and contain possibly lots of disjoint segments, but offers the possibility to export all the relation geometry 1:1.

The patch is against an older revision and untested to apply cleanly to latest. Sorry for any inconvenience.

Screenshot of the dialog
cp. to previous rev02rc adds additional option to sanitize output

Attachments (4)

josm_export_relation_to_gpx_r18721_rev02rc.patch (18.8 KB ) - added by cmuelle8 12 months ago.
revamp export relation to gpx feature
user-options-for-role-based-export.png (21.1 KB ) - added by cmuelle8 12 months ago.
sample screenshot
user-options-for-role-based-export-rev03rc.png (24.6 KB ) - added by cmuelle8 12 months ago.
cp. to previous rev02rc adds additional option to sanitize output
josm_export_relation_to_gpx_r18721_rev03rc.patch (20.9 KB ) - added by cmuelle8 12 months ago.
cp. to previous rev02rc adds additional option to sanitize output

Download all attachments as: .zip

Change History (12)

by cmuelle8, 12 months ago

revamp export relation to gpx feature

by cmuelle8, 12 months ago

sample screenshot

comment:1 by cmuelle8, 12 months ago

Description: modified (diff)

comment:2 by cmuelle8, 12 months ago

Type: defectenhancement

comment:3 by cmuelle8, 12 months ago

Priority: normalminor

by cmuelle8, 12 months ago

cp. to previous rev02rc adds additional option to sanitize output

by cmuelle8, 12 months ago

cp. to previous rev02rc adds additional option to sanitize output

comment:4 by cmuelle8, 12 months ago

Description: modified (diff)

comment:5 by GerdP, 12 months ago

It would be good to know the problems which are adressed by this patch. Maybe attach an example relation and explain why the existing code fails to do what it needed.

comment:6 by anonymous, 12 months ago

The existing code does not fail (where does it say that?). its an enhancement / improvement as the title says: add more flexibility when using the export feature.

depending on the data (some relations use the role attribute more heavily than others), it is quiet useful to be able to manipulate some setting during the export process.

One can compare this with the ConvertToGpx feature available on any OSM data layer: It offers to simplify way geometry, although it strictly would not need to offer this option when doing the conversion.

comment:7 by GerdP, 11 months ago

See also #23551.
I asked for an explanation because I don't understand how this patch improves JOSM. I've never used this Export action and therefore I don't know what to expect. I do understand that an incomplete relation will likely produce an unexpected result.

One problem that I found: It seems the patch doesn't handle the names of multiple selected relations properly. I tried with relations 12149161 and 10626592, the result contained two tracks with the same name.

comment:8 by anonymous, 4 months ago

There's a lot of 'I' in your comment, but JOSM is not written with one particular person in mind. Even if _you_ do not need the feature there are users that do find it useful.

The feature was not written / intended for the case that multiple relations are selected, maybe the context menu should not offer the option when more than one is selected.

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