JOSM/Plugins/Tracks2Map
The JOSM plugin Tracks2Map opens all GPX tracks in the current map view from a specified directory. It can optionally work recursively on subdirectories. Only those tracks, are opened that actually cross the map view. If available, associated markers are opened as well.
As the plugin may open a number of GPX track layers and GPX marker layers at a time, it also provides a menu option for deleting all GPX layers at a time.
Configuration
Preferences dialog
- From the JOSM menu bar, select
Edit -> Preferences
. - In the opened preferences dialog, select the tab
Tracks2Map
. - Select the directory with your recorded or gathered GPX tracks via the file chooser dialog and check the
Recursive
option as needed. - Click the
OK
button at the bottom.
Configuration options
Option | Default | Description |
---|---|---|
GPX Track Directory | null | Path of the directory where the recorded or gathered GPX tracks are located. |
Recursive | true | If enabled, the plugin will work on subdirectories recursively. |
Usage
Tracks2Map adds two actions to the JOSM file menu:
Open all tracks in map view
: Opens all GPX tracks which cross the current map view from the specified directory and optionally its subdirectories.Delete all GPX track and marker layers
: Deletes all GPX layers at a time so they do not need to be closed one by one.
Toolbar icons
The two above mentioned menu actions can be added to the toolbar as icons:
- From the JOSM menu bar, select
Edit -> Preferences
. - In the opened preferences dialog, select the tab
Toolbar
. - In the tree
Available
on the right, expand theFile
node and select the Tracks2Map menu actions. - Click on the button with the blue arrow to the left which is located in the middle section.
- The actions are now part of the toolbar list.
- Use the light blue up and down arrows to adjust the position of the icons in the toolbar as desired.
- After clicking
OK
, the icons will be available in the toolbar.
Opening all tracks in the current map view
When executed in a JOSM session for a specified GPX tracks directory for the first time, the action may take some time to finish (depending on the number of GPX files) as all GPX files in the directory (tree) have to be opened and the track bounds have to be determined. The next time that the action is executed, it will run much faster as the track bounds are kept in memory and therefore only new GPX files or GPX files with track bounds intersecting the map bounds will be opened to check if the track actually crosses the map view.
To provide the user a feeling of the time required to finish, a progress dialog is shown each time that the tracks open action is executed.
Source code
The source code can be obtained from JOSM Tracks2Map Plugin on GitHub.