table of contents
VIKING(1) | Viking 1.10 | VIKING(1) |
NAME¶
viking - program to manage GPS data
SYNOPSIS¶
viking [-d | --debug] [-V |
--verbose]
[--latitude degrees --longitude degrees]
[-z | --zoom ZoomLevelOSM] [-m |
--map MapId]
[-c | --config-dir directory] [-e |
--external] [-r | --running-instance]
[file...] | [-]
viking [-h | --help]
viking [-v | --version]
DESCRIPTION¶
Viking is a program to manage GPS data.
You can import and plot tracks, routes and waypoints, show OpenStreetMap (OSM) and/or other maps, generate maps (using Mapnik), geotag images, add coordinate lines, make new tracks, routes and waypoints, hide different things, etc. It is written mainly in C with some C++ and uses the GTK+ 3 toolkit. It is available for Linux, other POSIX operating systems and Windows.
Homepage: http://viking.sf.net
Viking is licensed under the GNU GPL.
Viking also provides a more extensive manual accessible via the program that expands on some of the concepts introduced here.
DETAILS¶
Details.sp
Table 1. File Reference
Values | Description |
file(s) | Read the specified files in sequence left to right |
- | Read input from standard in. No other files should be specified |
Note that the ordering of files can be important depending on their file type. Subsequent non Viking project files are loaded into the previous Viking project, with the files being processed left to right. Some examples:
Here all GPX files are loaded into a new Viking project in one window.
Each Viking project file is opened in a new window.
The GPX files are loaded into the Viking project in one window.
The GPX files are loaded into a new Viking project in a one window and the Viking project is loaded seperately in a seperate window.
Table 2. Command Line Reference
Short Option | Long Option | Description |
-h | --help | Show the command line options and then exit. |
-V | --verbose | Run in verbose mode. Some information about what Viking is doing is shown in stdout. |
-d | --debug | Run in debug mode. Even more information about what Viking is doing is shown in stdout. This also enables some extra information features in the GUI itself, primarily of interest to developers. |
-v | --version | Show the version and then exit. |
N/A | --latitude | Set the initial position to the specified latitude in decimal degrees. |
N/A | --longitude | Set the initial position to the specified longitude in decimal degrees. |
-z | --zoom | Set the initial zoom level. The value is the OSM zoom level (0 - 22). |
-m | --map | Add a map layer by specifying the map id. The value needs to match one of the internal ids or an id from the Map Source Extensions. Specifying a value of 0 will use the map layer default. Specifying any negative value e.g. -2 will not show a map (overriding the GUI preference that automatically adds one at startup) |
-e | --external | The files specified on the command line will be loaded in as external files as per the External reference:??? method. Applies to GPX, FIT, KML or TCX types, thus has no effect on .vik files. |
-c | --config-dir | Use an alternate location (which will be created if it does not exist) for the configuration directory. This is useful for using/trying specific configuration values for a particular session without changing ones normal settings. |
-r | --running-instance | Opens the specified files in an already running instance of Viking. If no instance is available than the files will not be opened. Positional and map option parameters are not used or passed on to the running instance. .if n .sp 4 Note This option is not available on Windows(TM) |
Table 3. Internal Map Ids
Map | Id |
4UMaps | 801 |
Bing Aerial | 212 |
Blue Marble | 15 |
CalTopo | 29 |
CyclOSM | 65 |
pnvkarte Public Transport | 101 |
OpenSeaMap | 600 |
OpenTopo | 901 (current default) |
OSM Cycle | 17 |
OSM Humanitarian | 22 |
OSM Mapnik | 13 |
OSM Transport | 20 |
OSM GPS Traces | 33 |
Waymarked Trails Cycling | 702 |
Waymarked Trails Hiking | 701 |
Waymarked Trails MTB | 703 |
Waymarked Trails Riding | 705 |
Waymarked Trails Skating | 704 |
Waymarked Trails Winter | 706 |
The current list of available Maps and their Id, including the
built in ones listed above plus any additional ones added by extended
configuration, can be viewed in the main program by going to
Help → Maps Information
An example to open at a specified location with an OSM Mapnik map layer:
viking --latitude 51.4 --longitude -1.3 --zoom 12 --map 13
If a file is also specified on the command line, the command line location and zoom parameters will take precedence.
Viking supports RFC5870[1], the 'geo' URI scheme. Every 'file' on the command line is checked to see if in fact it is a geo URI. Thus the above example in geo URI format is:
viking geo:51.4,-1.3?z=12 --map 13
Note
As a special combination when both -V and -d are both enabled at the same time, Viking will not delete some of the temporary files created during the program run. This is especially useful to monitor results of download requests (which need to be interpreted) if they suddenly start failing, as the file will have often more detailed information about the failure mode.
Viking being a GTK+ program means some options are processed by GTK+ itself such as --display. Use the following to find out what they are for your system:
viking --help-gtk
EXTENDING VIKING¶
Extending Viking.PP
Overview.PP
Currently, Viking has some extension points based on configuration files. The file format is heavily inspired by the GtkBuilder file format: you specify the class of the GObject to build and set its properties. Technically, it is a XML file containing a "objects" root element. Inside this element, you set a collection of "object".
Here is an example:
<objects>
<object class="ClassName">
<property name="property_name1">Property value</property>
<property name="property_name2">Property value</property>
</object>
... <objects>
You can find more examples as installed on your system and in the documentation part of the distribution. Typically these will be installed into one of the $XDG_DATA_DIR locations, such as /usr/share/viking/ or C:\Program Files\Viking\data depending on the Operating System.
It is also possible to override the internal defaults e.g. to update any parameters should they change over time, by adding the values into your configuration file. When you define object group that already exists (and for Maps this means by a repeated Id key, but you may have to examine the source code to work out what the relevant Id values are) then you need to define all the other keys as well, otherwise they will be reset to the defaults.
Map Sources.PP It is possible to add new map sources. The file is maps.xml placed in your User Configuration File Location.
An example of the file is in the distribution doc/examples/maps.xml. Further examples and values are online in the Maps Wiki[2]
The VikSlippyMapSource allows declaration of any map source working like OpenStreetMap. It supports the following properties:
id
name
label
hostname
url
Note
The full parameterised address can just be put in the URL field and the hostname field doesn't need specifying.
e.g. "https://tile.openstreetmap.org/%d/%d/%d.png"
user-agent (optional)
custom-http-headers (optional)
Multiple headers can be specified by separating each part with an '\n'.
The header allows of substitutions of values of the positional Z, X and Y (in that order) values, as per the url option above. Using multiple and/or different ordered values can be acheived via printf() positional argument specifiers. For example:
DNT: 1\nLine2: %d %d %d\nReordered: %3$d %1$d %2$d
copyright (optional)
license (optional)
license-url (optional)
zoom-min (optional)
zoom-max (optional)
lat-min (optional)
lat-max (optional)
lon-min (optional)
lon-max (optional)
file-extension (optional)
If the tile source is not a PNG file, then this parameter can be used to specify the naming to give consistent extension filenames on disk.
This can also be useful in reading a tileset from other software which may name tiles in an alternative form, e.g. for Mobile Atlas creator it names them .png.tile
Note
The file types actually usable are those supported by GDK Pixbuf Library, which includes at least PNG and JPEG.
Note
Remember to include the beginning '.' when specifying this parameter.
use-direct-file-access (optional)
This can also be useful for tilesets already on disk as it will avoid attempting to download any tiles.
Thus with this type the hostname and url parameters are not necessary and are ignored.
offset-x (optional)
Use negative numbers to adjust in a westerly direction.
Typical usage would be aligning differing maps, e.g. aerial imagery may be offset from cadastral maps.
Currently this is a single value that applies to all zoom levels.
offset-y (optional)
Use negative numbers to adjust in a southerly direction.
switch-xy (optional)
The default is false.
check-file-server-time (optional)
The default is true.
use-etag (optional)
The ETag value is stored in a separate file in the same directory as the tile to enable checking the value across multiple runs of the program.
referer (optional)
follow-location (optional)
tilesize-x (optional)
tilesize-y (optional)
scale (optional)
Note
Use a value of 2 to represent high res tiles. Don't change the tilesize as the internal display size is still based on 256 pixels.
The VikTmsMapSource allows declaration of any TMS service. A TMS (Tile Map Service) is defined in Tile Map Service Specification[4]. The configuration supports the following properties (as per VikSlippyMapSource above):
The VikWmscMapSource allows declaration of any WMS or WMS-C service. A WMS (Web Map Service) is defined in WMS Tile Caching[5]. The configuration supports the following properties (as per VikSlippyMapSource above):
An example of the file in the distribution doc/examples/goto_tools.xml.
Currently, there is a single object class available: VikGotoXmlTool. This feature allows one to declare any search engine using a XML format as result.
The related properties are:
label
url-format
lat-path
lat-attr (optional)
lon-path
lon-attr (optional)
referer (optional)
follow-location (optional)
user-agent (optional)
custom-http-headers (optional)
Note that unlike custom-http-headers for Tile download requests, it does not perform any value substitions in this string.
As a facility (or readability) it is possible to set both path and attribute name in a single property, like an XPath expression. To do so, simply set both info in lat-path (or lon-path) in the following format: /root/parent/elem@attribute. External Tools.PP It is possible to add new external tools. The file is external_tools.xml placed in your User Configuration File Location.
An example of the file in the distribution doc/examples/external_tools.xml.
The VikWebtoolCenter allows one to declare any Webtool using a logic based on center coordinates and zoom level value.
The related properties are:
label
url
The VikWebtoolBounds allows one to declare any Webtool using a logic based on bounds coordinates.
The related properties are:
label
url
An example of the file in the distribution doc/examples/routing.xml.
The VikRoutingWebEngine allows one to declare a routing engine available via HTTP.
The related properties are:
id
label
format
Use gpsbabel --help on the command line to find out the supported file types and their codes to process them.
Some format codes are handled natively by Viking such as gpx and kml.
A special format code of viking-geojson-osrm is available for handling responses by OSRM[6] route servers.
url-base
url-start-ll
url-stop-ll
url-via-ll (optional)
url-start-dir (optional)
url-stop-dir (optional)
url-ll-lat-first (optional)
For instance using Brouter services, the URL uses a pair of values which is longitude and then latitude. Thus setting this value to FALSE ensures the value substitution is performed in the necessary order.
referer (optional)
follow-location (optional)
user-agent (optional)
custom-http-headers (optional)
Note that unlike custom-http-headers for Tile download requests, it does not perform any value substitutions in this string.
The file is datasources.xml placed in your User Configuration File Location.
An example of the file is in the source distribution doc/examples/datasources.xml.
The VikWebtoolDatasource allows one to declare any URL using logic based on coordinates.
The related properties are:
label
url
The order and meaning of these parameters is given by the url_format_code below
url_format_code
B = Bottom of the current view i.e. minimum latitude
L = Left of the current view i.e. minimum longitude
T = Top of the current view i.e. maximum latitude
R = Right of the current view i.e. maximum longitude
A = center lAtitude of the current view
O = center lOngitude of the current view
Z = OSM Zoom value of the current view. See Zoom Levels[7]
P = selected Point's latitude
N = selected poiNt's longitude
S = A user specified input string requested from the user via a dialog box
Thus for the url example above then the format code should be AO
file_type
If it is not defined then the returned file is interpreted internally as a GPX file.
Possible values such as 'kml', 'mapsource' etc.. can be used. See GPSBabel File Formats[8] for the full list.
babel_filter_args
E.g. "-x nuketypes,routes" can be used to filter all routes from the results.
input_label
It is the label of the text input box.
referer (optional)
follow-location (optional)
user-agent (optional)
custom-http-headers (optional)
The $XDG_DATA_DIRS environment variable can be used to change these directories.
The $XDG_DATA_HOME environment variable is also used (if set) to look for these extension files.
FILES¶
Configuring Viking.PP
User Configuration File Location.PP
Viking looks for its configuration files (viking.prefs, viking.ini, viking.ini and keys.rc) in a specific directory, searching legacy locations first before trying new locations. Thus if you upgrade Viking it will continue to use your existing setup.
For UNIX(TM) like systems:
Up to v1.8
(typically /home/username/.viking)
From v1.9 onwards
Typically ~/config/viking/
For Windows(TM) systems:
v1.8 or earlier
v1.9 onwards
For Mac(TM):
/Library/Application Support/Viking
Note
If you've upgraded Viking to v1.9 and want it to use the new location, you will have to manually move the existing directory (when Viking is not running). e.g. in the command line: mv ~/.viking ~/.config/viking
Note
The User Configuration File Location directory can be overridden for the current session by explicitly setting the configuration directory via the --config-dir command line option. See the section called “Details” for more detail.
These values are stored in the plain text file viking.prefs Miscellaneous Settings.PP Various individual values are automatically saved between Viking sessions in the viking.ini file placed in your User Configuration File Location.
This file is not intended to be manually edited, but since it is a plain text file it can be changed if desired.
Some values in this file are non-GUI, in the sense that there is no way to set it other than by manually entering in the keys and values (the key will not exist in the file otherwise). This allows some fine tuning of Viking behaviours, without resorting to recompiling the code. However is it not expected that these values should need to be changed for a normal user, hence no GUI options for these have been provided.
Here is the list of the non-GUI keys and their default values.
See CURLOPT_CAINFO[10]
For Windows(TM) systems: curl_ssl_verifypeer=0
See CURLOPT_SSL_VERIFYPEER[11]
Note
If you encounter issues downloading from https sources, setting this to 0 should get HTTPS connections to work. For UNIX(TM) like operating systems SSL Certificate management is typically handled system wide and trusted certficate issuers updated regularly. Whereas for Viking under Windows this is only done at installation/version update time and so may become out of date or encounter unknown sources and thus more likely to raise verification failures. Hence this is why is is turned off by default on Windows(TM) - especially to ensure the default Maps of OpenTopoMap work without manual user intervention.
Override the default HTTP User-Agent (which is otherwise generated automatically from a combination of Viking's name, the version and curl information) set in all download requests with the value specified.
Also see CURLOPT_USERAGENT[12]
NB The User Agent for individual downloads/requests can be set via the relevant user-agent property when defining use of additional resources.
To enable the export to the little used GPS Mapper format option, set this to true.
To enable the export to the little used GPS Point format option, set this to true.
Set the integer value for the accuracy level request to the GeoClue service. Values to match the GClueAccuracyLevel[13]:
ATM Only attempts to remove a suspicious first point of a GPX track (as opposed to any points within a track).
Over this speed (in metres per second) for the first pair of points - the first point is removed.
Create new TrackWaypoint layers without showing the layer properties dialog first.
0=No markups. 1=Day marked. 2=Day marked and tooltips created. 3=Auto (timed tooltip creation, so if too slow it reverts to 1).
If the following message is shown in the message log:vik_layers_panel_calendar_update: detail level reduced as taking too longthen consider setting this value to 2 - although with the caveat that calendar refreshes may introduce noticable delays.
Note
maps_cache_status_*_color value strings are passed directly into the low level function gdk_color_parse()[14].
The string can either one of a large set of standard names (taken from the X11 rgb.txt file), or it can be a hexadecimal value in the form "#rgb" "#rrggbb", "#rrrgggbbb" or "#rrrrggggbbbb" where 'r', 'g' and 'b' are hex digits of the red, green, and blue components of the color, respectively.
Particularly if one often views large .vik files, then changing the visibility of items may be considered just part of the viewing process. Thus maybe you don't want to be notified on exit about such things - in this case you can set this value to true.
Allows using an alternative service for acquiring DEM SRTM files. Note that the layout on the server needs to be split into Continent directories.
Set to true to force the use of HTTP Basic Authentication even when OAuth is available
Options are: Pan, Zoom, Ruler or Select
Time to wait between move scroll events before redrawing
Time to wait between zoom scroll events before redrawing
Sensitivity factor for pinch zooming. Best to use keep this value somewhere between 0.5 and 3.0 - a higher value is more sensitive.
If your desktop environment doesn't automatically mount USB storage devices or you wish to also manage it in Viking - then set this to a device's drive label e.g GARMIN or UUID value.
Viking will then put menu entries under Help so you can be manually perform operations as required.
This is provided as a very basic opt in feature, only allowing specification and management of just one device via some additional menu entries. Presently no intention to make this a more fully fledged feature; USB device management is left to other programs.
This string is in the Message Format Code
This string is in the Message Format Code
This string is in the Message Format Code
In metres.
Go Back or Go Forward requests over this range from the last history location will move back to that position. If within this range it will skip over this location and move on to the next saved history location.
If Viking doesn't automatically detect a high resolution display, you can force the setting here - typically by setting this to 2.
In milliseconds
Viking should show a popup with the name of the current track selected. If it is not shown (perhaps you have a slowish machine), try increasing this value.
Or in Windows it uses C:/Progra~1/Rednotebook/rednotebook.exe - This string value must use Unix separators and not have spaces.
Or in Windows use C:/Progra~1/Stellarium/stellarium.exe - This string value must use Unix separators and not have spaces. Needs to be version 0.15.0 or greater (otherwise due to this Bug[17] means this does not actually work).
Or in Windows it uses notepad - This string value must use Unix separators and not have spaces.
A date format description[18] as passed on to strftime(). Note that when displayed in tables sorting by this column simply uses the text value, rather than the underlying date/time value.
UNIX = "/media/user/GARMIN/Garmin/GPX"
WINDOWS = ":/Garmin/GPX"
Older Garmins limits are typically much lower - Etrex 20/30 is 500
You may want to use something like: "/media/user/GARMIN/Garmin/CustomMaps"
Override the base search location for photographs
A matching dated directory corresponding to the track is attempted of the format /geotag_photo_dir/YYYY/MM/DD
The fallback format used in generating timestamps for waypoints from their comment
By default Viking uses the low level function gtk_show_uri_on_window() function to open URLs, which typically results in opening a new instance of a web browser.
This can be overridden by setting this configuration value to true and setting the environment variable BROWSER to invoke the desired browser, optionally including command line parameters to invoke the desired behaviour; such as "firefox --new-tab".
One could even have a more complicated string to run a specific version with a specific profile, e.g. BROWSER="/home/rob/Downloads/firefox/firefox -P 'Nightly' --new-tab" viking
Note that if you set BROWSER, other programs may also use this value.
This is not applicable on Windows as currently Viking uses the low level function ShellExecute() method to open URLs.
Each character represents what should be inserted in relation to a Trackpoint.
One day it might evolve into something more user friendly with a frontend to control it, perhaps allowing arbitrary text too. However for now at least some control is offered :)
Character Code
K = Some text to display at the start of the message - Trkpt
A = Altitude of a Trackpoint
S = Speed of a Trackpoint
B = Vertical Speed (Climb)
C = Course of a Trackpoint
L = Location of a Trackpoint
T = Time of a Trackpoint
M = Time diff of a Trackpoint from the previous trackpoint
X = Number of satellites used in the trackpoint fix
D = Distance of the trackpoint from the start of a track (following along the track)
F = Distance of the trackpoint from the finish (end) of a track (following along the track)
P = Distance difference of the trackpoint from the previous trackpoint
N = Name of track to which the trackpoint belongs
E = Name of the trackpoint
Output Notes
If the output has ** after it, then difficulties were encountered in trying to work out the value so probably a default of 0 will be shown.
It is in the standard GTK Accelerator map format. Values are automatically read in and saved between Viking sessions.
This file is not intended to be manually edited, but since it is a plain text file it can be changed if desired.
ENVIRONMENT¶
XDG_DATA_HOME
XDG_DATA_DIRS
VIKING_MAPS
AUTHOR¶
This manual page was originally written by Ralf Meyer <ranfyy@gmail.com> for the Debian(TM) system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
COPYRIGHT¶
Copyright © 2007 Ralf Meyer
Copyright © 2010 Guilhem Bonnefille
Copyright © 2021 Rob Norris
NOTES¶
- 1.
- RFC5870
- 2.
- Maps Wiki
- 3.
- ETag
- 4.
- Tile Map Service Specification
- 5.
- WMS Tile Caching
- 6.
- OSRM
- 7.
- Zoom Levels
- 8.
- GPSBabel File Formats
- 9.
- XDG Base Directory compliant
- 10.
- CURLOPT_CAINFO
- 11.
- CURLOPT_SSL_VERIFYPEER
- 12.
- CURLOPT_USERAGENT
- 13.
- GClueAccuracyLevel
- 14.
- gdk_color_parse()
- 15.
- rednotebook
- 16.
- stellarium
- 17.
- Bug
- 18.
- date format description
2025-10-02 | Viking |