One Step Further: Smoother Coastlines & Raster Layers


ONE STEP FURTHER #1: Smoother Coastlines

As you saw in the first tutorial, some areas of the coastline may look a little bit messy, due to the geographic complexity of the region. That is the case, for instance, of the south of Chile or the fjords of Norway. There is a way to simplify the coastlines.

Let’s take the example of Northern Europe, including Norway and its numerous fjords.

1 norway before simplifying

In order to obtain a simplified rendition of the western coast, let’s open the Simplify Geometries tool that you can find under Vector then Geometry Tools.

1 simplify geometries

A new window then opens. Make sure you are selecting the right layer to modify. You may want to tick the Save to new file box or you might lose the original layer.

The most important option is the Simplify tolerance scale. This depends on the scale your map will be at. If you want to work exclusively on Norway, but you think there is still too much detail, you may want to choose a very mild scale (0.01 for instance). If you are working globally and you only want to get rid of the ‘messy’ aspects of certain parts of the world, opt for a bigger ratio (0.1). Please note that anything above 0.5 will have a very significant impact on your map.

 

I have opted for 0.1. After clicking OK the result is deplayed along side many red dots.

1 norway before finalising

These are the angles of the layer that you can keep editing (we will see this in a later tutorial). Click on the Toggle editing button if done, and confirm that you wish to save the layer.

1 norway after simplify
This option simplifies your layer: it reduces the number of lines, and therefore the result may not be satisfactory to you, as it looks too rough and not round enough. You can use a second option (either combine it with the first one or use it on its own) called the Generalizer.

1 pluginsBefore being able to use it, you need to install the plugin into QGIS. To do so, go to Plugins and Manage and Install Plugins. Search for Generalizer and make sure the box is ticked and the plugin installed. Then click again on Plugins and choose Generalizer.

 

The Generalizer is composed of many algorithms which will all be very useful to complete a certain task. Remove small objects, for instance, will get rid of tiny islands so your map looks tidier. No matter what algorithm you are choosing, make sure you select the right layer. Once you click OK, a new window will ask for a CRS. Pick the same as your original layer, most commonly WGS 84.

1 generalizer

There are several algorithms available to make coastlines look smoother. I am choosing Chaiken’s Algorithm, which is pretty easy to use as it is separated in levels.

Here are the results with Level 1, Weight 3.00 combined with the previously simplified map.

1 europe after gen and simpl

If I’m starting from the original coastline layer (without simplifying), this algorithm is not very effective. I am opting for another algorithm (Boyle’s Forward-Looking Algorithm, look-ahead 10).

1 norway gen

Three tips:

  • The advantage of Generalisation is that it automatically creates a new layer. You won’t lose your original layer.
  • Finding the right algorithm and the right level of details may take some time, be patient.
  • Be aware that these plugins will slow down your computer. Avoid having many other applications open. 

 

ONE STEP FURTHER #2: Raster Layers

Now that your map has borders, rivers, and lines, you might want to add any topographical element, like terrain. These types of layers are called raster layers, since they cover a surface rather than just lines and dots. The files usually have a much bigger size. Once again, Natural Earth Data has a good collection that you can play with. Let’s download the Natural Earth 1 raster layer, which focuses on land.

The process is nearly the same, but you will need to select Add Raster Layer and select the TIFF image that you just unzipped. Our result is even more convincing now. You may tick or untick your other layers in order to see what format is best for you. In this case, you might want to focus on pieces of land and dismiss rivers. QGIS allows you to disable layers without having to totally removing them.

6 world map with raster layer

 

(In this case, we have reduced the coastline layer to 0.20 thickness to get a more subtle result)
 

Last update: 28 May 2015 on QGIS 2.8.1 Wien

Back to Tutorial 1: Base Layers | Next tutorial: Point Vector Layers