Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#18012 closed enhancement (fixed)

[PATCH] Using original gpx name on spliting gpx to new layers

Reported by: iman Owned by: team
Priority: normal Milestone: 19.10
Component: Core Version: tested
Keywords: gpx split tracks name Cc: cmuelle8

Description

Hi, sometimes I have a very long gpx and want to split it in shorter tracks.
I mostly use the "split tracks to new layers" feature available in JOSM.
But new tracks are always named GPX split result, GPX split result #2, etc.
It would be much more useful:

  1. to reuse the original track name instead of GPX split result
  2. and also append numbers starting from 1 (So we'll have a new name for every new splitted track).

Thanks

Attachments (1)

create-trackseg-names-from-gpxLayerName-if-there-is-no-name-attribute-attached.patch (4.7 KB ) - added by cmuelle8 5 years ago.
create trackseg names from gpxLayer name if there is no 'name' attribute present in track or trackseg data of the actual gpx; the gpxLayer name, by default, is named according to the filename on opening

Download all attachments as: .zip

Change History (7)

comment:1 by Don-vip, 5 years ago

Keywords: tracks added; tacks removed
Owner: changed from team to Don-vip
Status: newassigned
Type: taskenhancement

comment:2 by Don-vip, 5 years ago

Cc: cmuelle8 added
Owner: changed from Don-vip to team
Status: assignednew

Seems related to #15606. @cmuelle8 would you like to take a look?

by cmuelle8, 5 years ago

create trackseg names from gpxLayer name if there is no 'name' attribute present in track or trackseg data of the actual gpx; the gpxLayer name, by default, is named according to the filename on opening

comment:3 by cmuelle8, 5 years ago

Has received little testing, but does seem to resolve OP's original issue.

Notes:

  • If there is one track with many segments and the operation "split segments to tracks" is chosen, the resulting tracks are named and numbered according to the layer name (you can check this by using INFO context menu option). This means they are assigned a gpx "name" attribute in doing so, which will also be used to name the new gpxLayers if "split gpx tracks to separate layers" is consequently used.
    • -> This has the implication that if the gpxLayer name is altered/renamed after "split segments to tracks" was called, the gpx "name" attribute will be preferedly used when "split gpx tracks to separate layers is called", i.e. renaming the layer does not change the trackseg gpx name attributes once they have been set.
  • Of a gpx with many tracks is opened (with one segment each), then "split segments to tracks" is available immediately and thus, if the tracks do not have a gpx "name" attribute assigned, gpxLayer name will be used to name the resulting layers.

Thoughts for future modification:

  • If the generated track names need to be editable after an "split segments to tracks" operation, it may make sense to vamp up the Info page and make the track names editable there (may be together with an option to remove the name attribute). But there's no priority on my side doing this now. The info page, afaik, consists of an html layout, no active Java components, reworking that presumably takes some effort compared to the patch attached now.

Greetings

comment:4 by Don-vip, 5 years ago

Milestone: 19.10
Summary: Using original gpx name on spliting gpx to new layers[PATCH] Using original gpx name on spliting gpx to new layers

comment:5 by Don-vip, 5 years ago

Resolution: fixed
Status: newclosed

In 15397/josm:

fix #18012 - create track segment names from gpx layer name if there is no 'name' attribute present in the actual gpx (patch by cmuelle8)

comment:6 by Don-vip, 5 years ago

thanks! :)

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.