When opening a geo-file for the first time in QGIS, random colors are assigned to the points, lines, and polygons. QGIS offers excellent features to design and use color style schemes. This article describes how to do this, with the objective as follows:
I was just seven years old when someone gave me the special topographic edition of the Walcheren map (scale 1:25,000), which completely blew me away. My general love for graphic design expanded with a passion for cartographic styling. So, when Kadaster (the Dutch national mapping agency) finally offered their famous dataset “Top10NL” (meaning: Netherlands vectorized at a nominal scale of 1:10,000) for free (as GML files), I was in a state of total bliss. At last I was able to style the famous topographic Dutch map with my own color styles. Moreover, QGIS directly reads GML files, so I thought this was going to be an easy job.
Unfortunately, when examining the formal datamodel of the Top10NL, one comes to realize that designing a color style scheme for such an expansive data set isn’t easy at all. Ordering the various submap layers requires careful attention, let alone the process of importing the submap layers in the first place! “Let’s import the GML files…” turned out to be an arduous process. Ordering the set itself was easy enough: My Internet order of Jan.3 was delivered the very same day by a download link on wetransfer.com. Kudos to Kadaster! But… the Kadaster GML3 files have the uncanny property of registering multiple datatypes within one object class. So, the submap “road-part” (NL: wegdeel) exists of both points, lines, and polygons. The GML import module in QGIS, delivered by GDAL, assigns the value “unknown” to such datatypes, which results in the following GML import box:
So this method stops short. Sometimes road parts are drawn as points, other times as lines, but never as three separate submap layers (point, line, polygon) which would of course have been the correct solution. But there are other disadvantages to directly using GML: performance of layers that do import correctly is remarkably slow as compared to, for example, shapefiles.
Fortunately, other people experienced the same problems and found solutions as well! An energetic group of people (with the label “NLExtract [link]” have written scripts that convert the Kadaster GML to a PostGIS database. Obviously QGIS is able to set up a neat connection to a PostGIS database. Together with a technically-oriented friend and some trial’n'error, we were able to convert the GML to a PostGIS database. On the screen the following data types appeared:
I was quite surprised to find that this dataset (national coverage!) in PostGIS, wich amounts to 10Gb, performs very fast in QGIS. Sure, screen rendering takes some time (depending on the zoom level), but exploring The Netherlands this way is quite an experience. For a basic map image, not all map layers are particularly relevant. For my color style experiment I imported the following layers (in that order: waterdeel_vlak, terrein_vlak, waterdeel_lijn, isohoogte_lijn, hoogteverschillz_lijn, hoogteverschilhz_lijn, wegdeel_vlak [tbv omlijning], wegdeel_hartlijn [tbv tunnels], wegdeel_vlak [tbv kleuring], wegdeel_lijn [tbv bospaden], spoorbaandeel_lijn, gebouw_vlak, inrichtingselement_lijn, inrichtingselement_punt, en geografischgebied_punt. I imported the municipal borders from the “Topgrenzen” dataset (as ESRI Shapefile) which is available for free.
Well, off we go. The water, ground surface (terrein) layers and iso_height lines were easy to configure (although I recommend keeping the official Top10NL data specification at hand; available as PDF through www.google.nl: search for “Gegevensmodel Top10NL”). QGIS offers a wide range of color settings. For polygons, not only the fill color, but also the edge width and coloring are configurable. Anti-aliasing (pixel softening) also works reasonably well and can be turned on or off (faster performance). Here follows an example of color styling of ground surface:
Configuring road colors is somewhat of a challenge. The Top10NL data set offers a variety of information for each road part. It’s possible to render a map to show asphalt and gravel roads; bus lanes, bicycle lanes, pedestrian areas; and that is in addition to the standard road type of street, local road, regional road, main road, and highway. With a little playing around, results become acceptable without having to add an extra instance of “wegdeel_vlak” for each road type. Tunnels are excluded by adding “hoogteniveau=0″ to the SQL WHERE filter query part. The difficult part comes with setting nice edges around the roads. I like edges around the entire road collection, but also between bicycle paths and main roads, but not on road crossings. This does require multiple instances of road-part submaps layers (“wegdeel_vlak”) with different settings, including some extensive SQL WHERE filtering. A peculiar issue arose when the road edges appeared around each individual road part, also with activated symbol layers. Theoretically, all road parts are strictly adjacent, but perhaps due to calculation issues, the closure isn’t 100%. So I had to expand the fill area of each road part just a little bit. Some examples follow:OSGeo wiki link Galerie: Almere OSGeo wiki link Galerie: Naarden OSGeo wiki link Galerie: Wijchen OSGeo wiki link Galerie: Zeist
Of course, improvements are always possible. For exmaple, I’d like to find a way to emphasize the different-heigh-level crossings of roads of the same type, that is, a highway that unevenly crosses another highway would have to be plainly visible. I’m interested in hearing the final solution on this…
A really nice observation when examining the new Top10NL (2011) release to the older Shapefiles (2009) is that the dataset is really improving in terms of quality (see below). Especially the building blocks are more precisely modelled. Of course, the next step is to use the extremely-precise BAG built-object contours (an official national base geo registry). This would save Kadaster a neat amount of maintenance work. The Top10NL is now redrawn every two years. There’s an ambition to get to a yearly upate.
These color style schemes are made available (as .qml files) through www.nlextract.nl.
Or through one zip file on here.
The naming of the color styles has been aligned as much as possible with the submap layer naming in the Top10NL. I’ve also attempted to export these styles as .SLD files, but there are certain features that the export plugins do not yet support. Again, any tips are welcome.
For additional questions, please do not hesitate to contact me at email@example.com. See also the map gallery at http://wiki.osgeo.org/wiki/Nederlands/Galerie