#7193 closed defect (fixed)
Opening more than two gpx-Tracks fails (regression)
Reported by: | anonymous | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | Cc: |
Description
Opening (Strg-O) more than two gpx-Tracks at once does not work properly.
Expected behaviour:
Open all gpx-files
Observed behaviour:
*Trying to open 3 gpx-files:
Two layers with third gpx-file and one layer with first gpx-file (second gpx-file missing)
*Trying to open 4 gpx-files:
Three layers with fourth gpx-file and one layer with first gpx-file (second and third missing) - or in other cases three layers with fourth gpx-file and one layer with second gpx-file (first and third missing)
Exact pattern hard to understand!
Console message lists "Open file: .....gpx (????? bytes)" correctly for all chosen files, however, the layers that appear within josm do not correspond to all gpx files!
This bug is a regression. It did not happen with older josm-versions!
Attachments (5)
Change History (19)
follow-up: 2 comment:1 by , 13 years ago
by , 13 years ago
Attachment: | layers.png added |
---|
Layers Dialog in JOSM (after semi-failed gpx-import)
comment:2 by , 13 years ago
Replying to bastiK:
Cannot reproduce, what version exactly?
Josm version 4717 with the following plugins:
lade Plugin 'openstreetbugs' (Version 27119)
lade Plugin 'turnlanes' (Version 26731)
lade Plugin 'ElevationProfile' (Version 27285)
lade Plugin 'licensechange' (Version 27241)
lade Plugin 'photo_geotagging' (Version 27019)
lade Plugin 'turnrestrictions' (Version 27241)
lade Plugin 'FixAddresses' (Version 27178)
lade Plugin 'RoadSigns' (Version 27241)
lade Plugin 'mapdust' (Version 27119)
lade Plugin 'public_transport' (Version 27241)
Silent shortcut conflict: 'menu:Public Transport' moved by 'menu:Presets' to 'Alt+A'.
lade Plugin 'ImproveWayAccuracy' (Version 27178)
lade Plugin 'download_along' (Version 27119)
lade Plugin 'OpeningHoursEditor' (Version 27178)
lade Plugin 'utilsplugin2' (Version 27289)
Silent shortcut conflict: 'menu:More tools' moved by 'plugin:roadsigns:dialog' to 'Alt+B'.
RemoteControl::Accepting connections on port 8111
comment:3 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
by , 13 years ago
Attachment: | shell_3-pgx-files.png added |
---|
Shell: corresponding to the 3-gpx-files case
comment:4 by , 13 years ago
Ok, we shouldn't share one GpxImporter instance for all files. Otherwise it's kind of random which layer is added in EDT.
comment:5 by , 13 years ago
As mentioned in the title of the ticket:
Opening one or two gpx-tracks works ok.
Opening more than two (i.e. three or more) leads to the failed behaviour.
Two more screenshots corresponding to the three gpx files case attached.
All plugins were deactivated to x-check if error is due to plugins - which seems not to be the case.
Refering to "comment:4": That sounds chinese to me. I hope you do not expect any reply from me on that, right?
comment:6 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | needinfo → new |
Can reproduce it.
Instead of the real loaded layers one or more layers are displayed multiple times. In the above example 15 layers aren't displayed and 2 are displayed more than once.
comment:7 by , 13 years ago
@bastiK:
Why do you add variables to GpxImporter at all? Importers aren't means to be constructed individually for each file and I don't see sense in changing that.
comment:8 by , 13 years ago
This is for Session support. I need to get the Layer object from the importer directly, in order to set visibility and stuff like that. I could ignore the FileImporter classes and use OsmReader / GpxReader directly, but the importer shows dialog messages in certain cases and these might also be useful when importing a session (?).
comment:9 by , 13 years ago
This should fix the problem, but I don't like it too much:
-
src/org/openstreetmap/josm/io/GpxImporter.java
41 41 String fileName = file.getName(); 42 42 loadLayers(is, file, fileName, tr("Markers from {0}", fileName), progressMonitor); 43 43 44 final GpxLayer gpxLayer = this.gpxLayer; 45 final MarkerLayer markerLayer = this.markerLayer; 46 44 47 // FIXME: remove UI stuff from the IO subsystem 45 48 GuiHelper.runInEDT(new Runnable() { 46 49 public void run() {
comment:10 by , 13 years ago
Can't you use a solution like the one in the patch I did and add a second importData(), which returns you the relevant structure containing all you need?
comment:12 by , 13 years ago
I have no time for a proper fix at the moment, feel free to use your approach.
comment:14 by , 13 years ago
A drawback of your method is, that it has to be applied to each Importer but creation of a new instance would only be at one place.
Cannot reproduce, what version exactly?