Page updated July 2018.
See my Step 4 page for installing Viking.
Using Viking to import data from a GPS unit
Only some Garmin units can transfer through USB to viking (see the list here
- works using a Garmin 60csx, but not a 62s)
- In Viking, go through File > Acquire > From GPS
- /dev/ttyUSB0 will be shown as the serial port
- select tracks and/or waypoints and hit OK
For a Garmin 62s (and many others on the list) hook up the device to a USB port and read the gpx and waypoint files through a file browser, search in the Garmin/gpx and Garmin/gpx/archived dir's.
Viking supports layers including map backgrounds, colour-coding of tracks, waypoint symbols, and a lot of track and waypoints editing tools.
You can also geotag photos by correlating them against a track that was made at the time of shooting photos. Your camera's clock would first need to be synced to the GPS unit's clock, to the second - but, just in case it wasn't, there is an offset option so that if the camera's clock was different to the GPS unit's clock at the time of shooting, Viking can add/subtract so many seconds to/from the pictures' own timestamps (without altering the image timestamp data), so that the pics are correlated to the right points on the track.
Also, you can write geo-coordinate data to multiple photos from any waypoint. Plus, any photos with geo info can be imported to the map via dragging from a file browser.
What's limited is the ability to print decent maps as only the visible screen is sent to the print dialogue, which makes it impossible to print large scale of areas off the screen.
Other limitations are lack of drawing or labeling tools, and that waypoint titles can get crowded and overlapped. But then, this is purely a data compiler, not so much a map production suite (aka GIS).
One bug to watch out for
is freezing of the program when zooming right down to the largest scale! So make sure you keep saving the work manually, every so often, because there's no auto-save or auto-recovery and you work can be lost!
Closing the program it doesn't ask to save your work either, although there is a toolbar button to "save and close."
Also there is no undo/redo function, which means that if you do something horrible you will have to re-open the last saved version.
Once you have collated your GPS data and tidied up tracks, renumbered the points etc, its time to make it presentable, with styled labels that don't overlap, polygon area shading, and quality image detail for printing.
What we need is Geo Info System software, and in Linux we have Quantum GIS (Qgis).
See my Step4 page for installing Qgis.
Update: Qgis is now at v3.0, which has seen some great improvements over v2.x. Notes below are updated.
Doumentation here: Qgis user manual
to import geo data from e.g. Viking, first export the layers from Viking as GPX files, then in Qgis,
- open the Data source manager (new)
- click on Vector layer button at left, select file and click Open, then click on Add, then select which attributes to import (routes, tracks, waypoints etc), and OK
The imported Vector layer from GPX file appears as a new layer in the Layers panel, you can rename the layer by pressing F2 if necessary.
New to Qgis is the Layer Styling panel
to the right. Here you can set track line style and colour, waypoint symbols, and whether to have labelling for the Layer. Tracks may not be too visible until you set a different line style. Style and Labelling is also found in the Layer properties dialogue.
Vector layers from GPX source files are easy to update with new data. Once you have added tracks or waypoints or edited names, export the data to the same GPX file using Viking. Then click on the QGIS Refresh button
, or zoom in and out if the Render box is checked at bottom of screen.
the only problem this may give you is that if you have changed the placement of labels and rotated them, and then the source file track/waypoint names are changed, refreshing the layer in Qgis may reset the placement/rotation of labels, as the changes were stored by the previous names.
Symbols and Styles
Using multiple symbol or line styles in a single layer
- in the Layer Styling panel, on the paintbrush tab, select "Categorized" instead of "Single Symbol"
- for "Column" scroll with mouse wheel to select 'name'
- click on Classify below
- select points to change
- right click on points > change colour/size
- click on Change button above to select new symbol
- in Layer Styling, select a style such as Bridleway or Road
- click on the "Simple line" for each colour of the style and adjust the thickness
- for Road style, reduce thickness of the inner colour and leave it white, and leave the underlying colour wider to make it appear like a double line
- for Bridleway, make the underlying colour white to get a dashed line like a footpath
Filter waypoints/tracks in a layer
In case the source file has data that you don't want shown on the map canvas, you can either simply use Classify
as above, and uncheck the features that you don't need or you can include/exclude any names that fit an expression
- Select Categorize and then next to Column, click on the Expression button
- enter an expression such as "name" LIKE '%B%' that will show features of the layer with "B" in the name (where the %B% means containing "B" anywhere in the name)
- or "name" NOT LIKE '%B%' to exclude features with "B" in the name from the layer
- Click on test and Sample, to check if the filter is what you want, then OK
Use SVG symbols for waypoints
Get more svg symbols
- Layer Styling > Style > click on "Simple marker" under "Marker"
- to the right, at top, click on the Symbol layer type, select SVG marker on the drop down menu
- then below select category and symbol and change size and colour
add data to the beginning of the path data:
- web search "svg symbol tree" etc and download - or visit pixabay.com and sign up
- if downloading png images, use inkscape to convert to svg:
open png, Path > Trace bitmap (check greys, remove background)
- drag original bitmap to the side and fill the tracing with original colours
- save as Plain svg, not inkscape svg which has a larger file size
- copy to your Qgis svg folder (or to /usr/share/qgis/svg/ so that you can work on other computers and not lose your symbols because of different user name)
- in Qgis Settings > Options > System, add the path to the svg folder
- then in layer properties you can see your new svg symbols
To enable the symbol to have borders
- open the svg file in editor
- for every object in the svg there will be path data...
- remove the "style" data at the end of the path data
Qgis 3.0 now has a good labelling functionalty. With v2.x before, labels were positioned pretty badly, with no means to move them about and the only way to do so was with the EasyCustomLabeling
plugin together with the Memory Layer Saver
It looks like Qgis has now incorporated this very tool into the main program, which is great. Only, compatibility with Qgis and this plugin is not totally perfect (in the case of layers previously labelled using this plugin). The label layer shows fine in v3.0, but as soon as you adjust a label position then all the labels flip horizontal, which is bad news for a layer with 100's of labels all set correctly.
From now on I don't think we need to use the EasyCustomLabeling plugin, and it might very well become obsolete soon.
To turn on labelling for a layer,
- select a layer
- Layer Styling > abc tab > scroll button on "No labels" to select "Show labels forr this layer"
- for "Label with" scroll button down to select 'name'
- set colour and font style (but bold you need to click the override button next to greyed-out Bold and select 'name' from "Field type"!)
- to start moving labels, click on the move label tool, and click on a label - you then have to select a Key to store changes by
- to rotate a label (must be moved first before rotation possible) click the rotate label tool, click on a label and adjust its angle, Ctrl-drag for incremental 15 degrees.
the label placement on the map is not going to look the same when you create your Print Layout, as the labels on the map will show same size on any scale (to be human readable), but in the composer according to the font size/page size.
Ideally you want to set up a print layout before moving labels, set the right scale, and then start moving your labels. Switch between map and layout window and refresh the layout each time to see if the label positions are good.
Also, find a good scale in the project window to work with and stick with it (zoom out just to pan around then zoom back to work) so that you can judge distance from points that the labels need in order to show correctly in the layout.
Note that with Qgis 3.0, labels can auto-move
along a feature (especially tracks) when you zoom in/out or if you place a label near another one. So you need to check the labelling in the Layout window carefully. A label can also auto-hide if another label obstructs it (which is sometimes handy).
- click on the Highlight pinned labels button to see which labels have been moved
- click on the Change label button to edit the label or adjust font/size for individual labels
- to hide a label click on the Hide label tool then Shift-click on the label (but you can only hide labes of an active layer)
- to show hidden labels you need the Hide tool again and then you click on the feature the label belongs to (might need to zoom)
Tidy up label displays
In case you have some rather long waypoint/track names that are going to take up too much space on your map, you can add various functions so that the labels are shortened..
- Layer Styling > abc tab > click function button next to "Label with" at right
- click on the arrow by String to show functions and select, substr
- make the expression like this, substr( name,4 ) will cut all char's until 4th from left, or substr( name,-4 ) will cut all characters from end until the 4th from right.
- you can also use left( name,4 ) where 'left' retains characters from the left,
- or using regular expressions, regexp_replace( left( name,7 ) , '\\s[A-Z,a-z]+', '') where I replace a space (\s) and any characters left after retaining 7 first char - I wanted to retain only the waypoint code number
Calculate an area
If you draw an area then you'll have a polygon layer to work with.. -> click on New shape file, check on polygon and OK, and save it.. then click on the Edit and Add Feature buttons on the toolbar, and click on the map to start drawing - right click to finish (and enter the feature no.)
To edit the polygon area, click on the Node tool button and select a node - then either move it or double click to create a new node to move (but sometimes the new node is on top, sometimes underneath!).
There is a vector tool called polygonize (which needs shapely plugin), which will make polygons where lines cross and enclose space. So if you have an area completely enclosed, i.e. a track without gaps and its two ends cross over, closing the area, then you can try using this tool to find the area enclosed.
Processing > Toolbox > QGIS Geoalgorithms > Vector geometry tools > polygonize
You'll need to save the resulting polygons to a file as it only creates a temp layer.
You can run error checking with Vector geometry tools > Check validity
to see where there are faults in the lines, e.g. loops or crossing. But it won't show you if there are gaps.
Or, another way is to use Lines to polygons
, which will save the polygons to a shapefile layer:
Vector menu > Geometry tools > Lines to polygons
With your polygons, its easy to get an area calculation...
- select the layer
- open the Attribute table with toolbar button at top
- click on the Field calculator button
- Enter a new field name, i.e. "area"
- Select decimal number
- then expand "Geometry" and double click on $area
- you may need to add /1000 to the expression
- you should get a new column with area of each polygon
Toolbar > New Print Composer, name it, click OK..
or, Toolbar > Composer Manager, select a saved composer, click Show
- set the paper size first, A4, A3, A2, whatever size you need to print
- click on "Add new map" button then drag a rectangle over the tile, leaving some gap for a margin.
- click "Move item content" button, and drag map to center, zoom if needed with scroll button
- Set scale in Item properties tab to right > Main properties ..manual set best scale to fit what detail you need
- Set the map grid in Item properties > Grid ..Click the Add + button, set X,Y intervals to 0.05 or whatever (depends on the map scale?), check "Draw coordinates" and set whether they will appear above or below the border and how far from border
--> note that the coordinate ref system (CRS) for map raster layer is EPSG:3857 - WGS 84/ Pseudo Mercator, and this will rather alter how the grid is displayed in the print manager (showing ref's such as 11304000 instead of 101.550 which shows for EPSG:4326 - WGS 84, gpx vector layers) and the units will need changing to intervals of 3000 or so - but its easier to change the CRS back to EPSG:4326 so that coodinate format reads better, and you won't need to keep changing the unit intervals.
- Go down and uncheck "background" - this will be really helpful, especially if your map layer is transparent
- Add a scale bar - find the button on left toolbar - you need to play around with the "map units per bar unit" - I set it to 0.01, or 0.02, the units to meters and label "km"
- make a title with "Add new label" button (text box) and you can give it a frame, and white background with 50% transparency in case your map is a full page of terrain detail
- add a Legend - add with the button to left, can set auto update or manual if you want to remove some layers from it, and you can adjust coloumns, icon width
- to move objects around you need to select the move tool at left
- you can move objects with more control using the up/down/left/right keys, with Shift to move larger steps, with Alt to move in tiny steps
- Be careful to keep saving your work - the composer can cause Qgis to crash!
You can put symbols on the map too: draw a small shape and go to Properties > change fill, then select Simple symbol, SVG, or pattern...
If you need multiple pages to cover all your map detail you can add pages in a single composer - but bear in mind that with a large amount of layer data it will start to eat cpu and time to refresh, so multiple composers may be better, and you can copy-paste between them.
if you've prepared all 10 pages of B1 size with maps and titles and then you find you need another page inserted after page2, you'll have to move p3-10 down - so zoom out drag select all that content, cut, zoom in on p4, and paste at top corner (just save before you try it)
undoing a paste of so much data items will do it one by one, so to move everything if its placed wrong, select all that content and use left/right etc
Create an inlay map
How would you create a small map and set it as an inlay in the corner of a bigger map, the small scale one being from the same Qgis layers as the large scale map but without all the layers showing and smearing all over it?
Easy, you set Layer Visibility for as many layers as would smear on the small scale map, to become non visible after a certain minimum scale, leaving perhaps some layers to give the outline, such as rivers or roads. You could add special layers just for the inlay map too, such as county borders and set Layer Visibility minimum for them to large enough scale so that they won't show on the main map - although they might not fit on it anyway.
- Ctrl-click to select layers you need to set visibility for then right-click >> Set Layer Scale Visibility
- check the box and replace the default 100,000,000 with say, 50,000
- then in a print composer, create a new map and drag a small box in a corner, then set the scale to much smaller than the main map
- Or you could create a map on a new sheet, for example, to show what area is covered by a set of maps you've made - open your main map composer and switch between small scale map and that and draw boxes and place them on the small scale map to show coverage of the main map
- to find the box size of your map area on the small scale map, use main map width (e.g. 667mm) x scale (e.g. 10,000) / small scale (e.g. 80,000)
Background topo maps
1. OpenLayers plugin
then select a map via Web menu, Web > OpenLayers plugin > OpenStreet/Google/Bing...
To keep the map for offline use, turn off other layers and then Project > Save as Image
- then later you can add the map (provided the zoom level is still what you want) with Add Raster Layer
2. QuickMapServices plugin is much better
it offers transparency in the layer properties dialogue, and also, when you go offline the map data stays happy in the print composer (the above plugin prints blank squares if the connection is lost!)
Note! Unless the map fills the entire page in the print composer, when printing, your map layers will become mis-aligned with the background map, which is unaccepable and worthless. So when you prepare to print, stretch the map to snap to the edges of the page - this is the only way to prevent mis-alignment.
Contours from OpenDEM (SRTM)
This is a simple way to add nice-looking elevation data to your maps, albeit, without proper contour labels and only at 25m intervals.
Note that the data is under the Database Contents License (DbCL) which must be attributed in any public use of it.
- browse to the openDEM tile browser
- move the map to part of world
- press shift and drag an area
- select tiles to download from pop-up list
- unpack and import the shp file as vector layer
Set dark/coloured for 50m/100m intervals
- open layer properties
- select "Rule-based" from top-left selection (marker type)
- double-click the empty rule at top and give it a label, and a rule like so:
elevation LIKE '%25%'
- set the line colour to a pale sandy brown, leave it 0.26 thick, click OK
- copy and paste the rule 3 times
- click on the rule of each line to set the numbers to:
elevation LIKE '%75%'
elevation LIKE '%50%'
elevation LIKE '%00%'
- then right click on the 50 line and set line thickness to 0.46
- click on the 00 line and set thickness to 0.66, and a slightly darker sandy brown
- click OK to close
Try also downloading areas from http://extract.bbbike.org/
Loading layers in other projects
To use the layer in other projects, with its rules and line styles, you need to embed the layer into your new project...
Layer menu >> Embed layers and groups
then select a qgis project file and the layers to load in.
The problem is, however, you can't do anything to that layer (such as adjust line styles) as it belongs to the originating project. But what you can do is...
- right-click on the embedded layer, Styles >> Copy,
- then do Styles >> Paste on a layer that you want to have same/adjusted styles as the embedded layer
- for example, to create another contours layer in another project, you need to import the shapefile as Vector layer again then copy-paste the style including the line weight rules/colours from an embedded layer
Note: "Save as layer definition file" does not save any styles or categorized rules
Geo-referencing a scanned map
- Open Raster >> Georeferencer
- click on Open Raster and select your scan
- Then start making points on the scan where you have real coordinates for, such as grid intersections
- also you can click on the Pencil button to locate and click corresponding points on the Qgis map canvas - for example you have accurate GPS points for a specific land feature
- click on the cog icon and set how and where the Georeferencer will save the raster layer
- when ready hit Start Georeferencing button and a new layer should be added to Qgis project
Add Lat-Lon grid
View menu > Decorations > Grid - set "Interval X" and "Y" to 0.05, check "annotations"
Add scale bar : View menu > Decorations > Scale
(note that these will not be present in the print window - need to make others there)