Related Plugins and Tags

QGIS Planet

Mapping Open Data With Open GIS

This post explores some cartographic features of QGIS while mapping the river network of Tirol, Austria. All data used is freely available.

For the background, I downloaded NASA SRTM elevation data from CGIAR-CSI and created a hillshade using Terrain Analysis tools in QGIS 1.8.

To emphasize both state borders and the fact that Tirol consists of two separate areas, I created a mask using the Difference tool and styled it a transparent white.

The river network is too dense to label all rivers on an A4 map. Expression-based labels make it possible to only label selected features. For this dataset, the expression limits labeling to features with certain values of GEW_WRRL attribute:

CASE WHEN (GEW_WRRL = '10.000 km2 Fluss' OR "GEW_WRRL"= '4.000 km2 Fluss' OR "GEW_WRRL"='1.000 km2 Fluss') AND length("GEW_NAME_A") < 10 THEN "GEW_NAME_A" END

Labels of neighboring areas together with map title, descriptions and scale bar were added in Print Composer.

Working with Print Composer, it is useful to know that you can use Copy&Paste to duplicate map components and right-click to lock them from being moved. Also, every new component by default comes with a black outline and white background which can (and should) be disabled/changed in “General options”.

This is the final QGIS Print Composer output – without any further post-processing in Inkscape or Gimp:


Migrating a QGIS Project to New Symbology and Labeling

This is a follow-up to my recent “Natural Earth Quick Start Kit” post in which I presented the great quick start kit provided by the Natural Earth team. The QGIS project file they provide was written in QGIS 1.4 with both old symbology and old labeling:

Original Natural Earth Quickstart map centered on the Mediterranean

Since then a lot has changed. QGIS has a new powerful labeling engine which avoids label collisions and more advanced layer symbology. If that’s not reason enough to switch, it is also worth noting that both old systems will most certainly be removed for QGIS 2.0 release. Luckily, switching is pretty easy:

Switching to new symbology

In QGIS 1.7.4, switching to new symbology is very straight forward: Click the “new symbology” button in the upper right corner of the style tab and confirm the popup message. That’s it.

Switching to new labeling

Changing from old to new labeling is less automated. It will help if you take notes about font, size and colors as well as scale ranges before deactivating labeling in layer properties. Enable new labeling from the labeling toolbar and fill in the settings you have written down.

One of the known issues with new labeling is that it is currently not possible to rotate the labels without also specifying the label position. In most projects, this won’t be an issue though.

Updating the Natural Earth project

Besides switching to the new infrastructure, I’ve applied some minor changes to increase readability:

  • Buffers for city labels help where labels overlap with equally black country borders.
  • Buffers for capital symbols (stars) make them stand out over border lines.
  • Suppressed labeling for marine polygons smaller than 10mm avoids clutter.
  • Thinner river line styles with rounded corners make the map look cleaner.
  • A little halo around the land masses looks friendly.

The same map with new labeling and new symbology

I’ve uploaded the new project file version to QGIS Ressources on Github if you want to give it a try.


Natural Earth Quick Start Kit

Natural Earth is a great resource and you have probably already used it. One of the many nice things about Natural Earth is that it gets you started very quickly:
They offer a quick start kit that provides a sample of Natural Earth data as well as a QGIS project file. The project is really well done with appropriate scale-dependent styles and labels for all layers. A screenshot can capture only part of it:

The original Natural Earth Quick Start project

One potential point for improvement is labeling. The project uses old labeling and therefore suffers from label collisions. Changing to new labeling engine results in a clearer picture. (I’ve also added label buffers since both city symbols and labels are black and therefore can get difficult to distinguish.)

Another nice trick is to suppress labels for small features. The minimum size of features to be labeled can be set on the “advanced” tab of the new labeling dialog. In this case, I went with 10 mm to avoid labeling small marine polygons.

Changed to new labeling engine

I haven’t worked through all layers yet, but I am planning to share the updated project file back to the Natural Earth team.


Back to Top

Sustaining Members