My Account     Contact Us     Cart

Using MAP Themes to Automatically Style CanVec+ Data on Import in MAPublisher

Creating multiple maps that share cartographic styling is a common requirement for MAPublisher users. The most effective way to accomplish this is the use of MAP Themes. MAP Themes are a collection of thematic cartography tools designed to increase productivity by automating how styles and symbols are applied. Creating a number of MAP Themes based on regularly used layers with standard attribute schemas can greatly reduce the amount of time spent styling maps.

This guide will walk through creating and setting up MAP Themes to automatically apply to the appropriate layers upon import. If done correctly, rather than seeing this:


Unstyled CanVec+ layers

 

You will see this when importing data to MAPublisher:

Styled CanVec+ layers

1. Data Source

The data used in this guide comes from the publically available CanVec+ topographic database. CanVec+ contains a comprehensive set of layers optimized for display at 1:50,000 that are perfect for topographic mapping. In fact, many of these layers are used in the construction of the CanTopo Topographic mapping series available here.

The layers you receive from the CanVec+ download service will vary depending on what features are present in the extent chosen. The Geogratis Geospatial Data Extraction tool is the most convenient method to retrieve CanVec+ data. This guide uses a selection of CanVec+ layers styled similarly to the CanTopo maps.

All vector data was downloaded in an unprojected geodetic coordinate system and projected into a UTM projection MAP View.

The map shown above contains 12 vector layers and one raster layer, but we will only discuss the styling and configuration of three layers as the process is similar for the rest. You can download the Adobe Illustrator file at the bottom of the page if you want to examine the different layers, their graphic styles and MAP Themes.

MAP Themes are the primary method for applying attribute based cartographic symbology. A powerful feature is the ability to automatically do this on layer import based on geometry type or file name. By defining one or many graphic styles and a MAP Theme for each layer the layers can be automatically styled on import.

CanVec+ themes have a consistent naming scheme that makes them especially suitable for this sort of automated styling. Because each style is always named the same, it is simple to set up the MAP Themes to automatically apply when the layers are imported. The theme names are consistent but somewhat obscure, as are some of the attribute names and values. Luckily there is a specifications document that provides a guide to the various themes, datasets and attributes that are available. A link is provided in the useful resources section below. While the style guide is helpful, it can be difficult to navigate, so it has also been translated into a more easily readable Excel spreadsheet, which also available in the useful resources.

A CanTopo symbology guide is available for download and was used to help define the styles for the different layers used in this map. A link is available in the useful resources section at the bottom. The University of Toronto also hosts an old specifications guide, but as it is almost 14 years old it should not be assumed to be accurate. If you are looking for inspiration though, it is useful.

 

2. Example A: Building point locations

Building Symbols

2a. Building Point Symbol

The Graphic style for the building symbols is a black square rotated to match the value in an orientation attribute. Using the CanTopo symbology guide a correctly sized square was created and then added to the symbol library.

Buildings Symbol

2b. MAP Theme

A new Point Stylesheet MAP Theme was created called Buildings. The appropriate layer “bs_2010009_0” was added to the Theme and a rule was created named “All” as it will apply to all the building point locations. The Rule Expression is set to apply the Theme to all artwork as we want all the building points to look the same.

Buildings Rule Expression tab

The Visual Properties tab was used to determine how the buildings would appear. The Symbol property was set to use the Building black square symbol created and added to the Symbol library earlier. The Rotation property was set to use the “orientatio” attribute. This ensures the buildings are oriented correctly.

Buildings Visual Properties tab

Finally, and most importantly for the MAP Theme automation, the Auto-assign option was set so that any layer that matches the filename of the imported shapefile would automatically be styled using this theme.

Buildings Auto-assign setting

 

3. Example B: Contours

Contours

3a. Contours Graphic Style

Two Graphic styles were created for the contours: one for the regular contours and one for the index contours at intervals of 100m. Both are grey, with the index contours slightly thicker (although it is hard to tell in the Graphic Styles panel.)

Contours Graphic Styles

3b. MAP Theme

A Line Stylesheet MAP Theme was created called Contours. The layer “fo_1030009_1” was assigned to the MAP Theme. Two rules were created, one for index contours and one for regular contours. For the index contours, the Advanced Rule Expression builder is used to select any contour where the elevation is a multiple of 100, and the converse for the regular contours.

Index Contours Rule Expression

The Modulo (MOD) function makes this simple. For the index contours, the expression built as: “MOD(elevation,100)=0”. For the regular contours, the expression is “MOD(elevation,100)!=0”. The != operator means not equal to.

Contours Rule Expression

The Modulo function will be available with a future release of MAPublisher. If you are using an earlier version of MAPublisher, the same result for index contours can be had with this expression:

(elevation/100)-ROUNDDOWN(elevation/100,0)=0

If you do try and apply this MAP Theme with an earlier version of MAPublisher without changing the equations, it will not work and you will get errors.

Each rule is assigned the appropriate graphic style applied in the Visual Properties. Creating Graphic Styles in advance is much easier than trying to remember specific stroke/colour combinations and makes them re-usable.

Index Contours Visual Properties

It is worthwhile organizing them in the Graphic Styles panel and naming the Graphic Styles appropriately so you can easily remember which is which later.

Contours Visual Properties

The layer is then set as auto-assigned so that when it is imported in the future this MAP Theme will automatically be applied.

Contours Auto-assign setting

 

4. Example C: Roads

Roads

4a. Graphic Style

The Roads layer is the most complex as there are multiple different classes of roads, that are then broken down into sealed and unsealed surfaces, and can be at grade, tunnels or bridges. Several of the road classes are assigned the same Graphic Style, so each style was named after a representative road class and assigned to several MAP Theme Rules.

Roads Graphic Styles

4b. MAP Theme

There are defined styles of roads in the CanTopo specifications, but these do not map directly to the attributes that are present in the CanVec roads dataset. There are several attributes that hold information about the composition of the road, but the ones that were used to define the MAP Theme Rules were:

  1. roadclass: a heirachy of road types
  2. structype: defines if the road is a road, a bridge or a tunnels
  3. pavstatus: contains information on the road surface, if it is paved or unpaved.
Roads Attributes (many others are hidden)

A Line Stylesheet Theme was created called Roads. The layer tr_1760009_1 was assigned to this Theme. Each road class has its own rule. The rule expression determine what class of road it is, if it is a bridge or a tunnel, and if it is paved or unpaved. An example of this is “Arterial: Paved: Bridge” with the expression:

roadclass=3 AND pavstatus=1 AND (structype =1 OR structype =2 OR structype =3 OR structype =4)

which simply says select art that is an Arterial Road (roadclass=3) is paved (pavstatus=1) and one of four different types of bridge (structype 1 through 4).

Roads Rule Expression

As in previous examples, each rule is assigned a Graphic Style in the Visual Properties tab.

Roads Visual Properties

The layer is set to auto apply on import.

Roads Auto-assign setting

Once rules are created and applied to all the imported layers the end result looks like this:

Styled Layers overlaid on hillshade

 

5. Hillshade

In addition to vector data, the GeoGratis portal has raster terrain data available for download. There are digital elevation models, digital surface models, and a variety of derived products such as slope and aspect. For this map we downloaded a hillshade and adjusted the opacity so it would blend with the map style. The forest cover layer and the built up areas layer also had their blending modes adjusted so the hillshade would show through.

The hillshade was downloaded in an unprojected geodetic coordinate system and Geographic Imager was used to transform it into the UTM projection used for this map.

 

6. Final words

In order for the defined MAP Themes to be automatically applied to any imported data, the imported layer filenames must match those defined in the MAP Theme Rules as discussed above. If you would like to try it out with your own CanVec data extract, do the following:

  1. Download the “Canvec_Data_Themes.ai” file linked below for the version of Illustrator you are using. Have a look at the data structure, layer names and MAP View properties of this document.
  2. Also download the appropriate “Canvec_Data_Themes_Empty.ai” file to use as a template.
  3. Download an extract of CanVec data as shapefiles.
  4. Use the Advanced Import functionality to import the shapefiles into the empty document. Reproject the map if desired.
  5. The imported data have the styles applied automatically. However, you will probably have a few layers that have no style. Use the methods detailed above to create new styles for those layers.

 

7. Useful resources

CanVec Demo. (Created with MAPublisher 9.5.3, AI CC2014) – File Download
CanVec Demo – No Layers. (Created with MAPublisher 9.5.3, AI CC2014) – File Download
CanVec Demo. (Created with MAPublisher 9.5.3, AI CS6) – File Download
CanVec Demo – No Layers. (Created with MAPublisher 9.5.3, AI CS6) – File Download
GeoGratis Website
GeoGratis FAQ’s
CanVec Style Guide for Adobe Illustrator – File Download
CanVec Feature Catalog
CanVec feature Catalog Spreadsheet (Unofficial, non-maintained. For information only.) – File Download
University of Toronto Topographic Cartographic Symbols Archive


Leave a Reply





Blog Archive

December 2024 (1)
November 2024 (1)
October 2024 (1)
November 2024 (1)
September 2024 (1)
August 2024 (2)
July 2024 (1)
September 2024 (1)
June 2024 (1)
July 2024 (1)
May 2024 (1)
April 2024 (2)
May 2024 (1)
March 2024 (2)
February 2024 (1)
January 2024 (1)
December 2023 (1)
November 2023 (2)
October 2023 (2)
September 2023 (1)
August 2023 (1)
July 2023 (3)
June 2023 (1)
February 2023 (1)
January 2023 (2)
December 2022 (1)
November 2022 (2)
October 2022 (2)
September 2022 (1)
May 2023 (1)
August 2022 (2)
July 2022 (1)
June 2022 (2)
May 2022 (1)
February 2022 (1)
January 2022 (2)
August 2022 (1)
December 2021 (3)
November 2021 (5)
October 2021 (1)
September 2021 (3)
August 2021 (2)
July 2021 (1)
June 2021 (2)
May 2021 (2)
April 2021 (2)
March 2021 (3)
April 2021 (1)
February 2021 (1)
January 2021 (1)
November 2020 (1)
October 2020 (1)
June 2020 (2)
May 2020 (1)
April 2020 (3)
March 2020 (2)
December 2019 (1)
November 2019 (2)
September 2019 (1)
August 2019 (1)
July 2019 (1)
June 2019 (3)
May 2019 (4)
April 2019 (2)
March 2019 (1)
February 2019 (2)
January 2019 (3)
December 2018 (2)
November 2018 (1)
October 2018 (1)
September 2018 (2)
August 2018 (4)
July 2018 (2)
June 2018 (1)
July 2018 (1)
June 2018 (4)
May 2018 (1)
April 2018 (2)
March 2018 (4)
February 2021 (1)
February 2018 (1)
January 2018 (1)
November 2017 (1)
October 2017 (2)
August 2017 (2)
July 2017 (1)
March 2017 (1)
February 2017 (2)
January 2017 (2)
November 2016 (1)
January 2017 (1)
November 2016 (1)
October 2016 (2)
May 2016 (1)
March 2018 (1)
April 2016 (2)
December 2015 (2)
June 2015 (1)
May 2015 (1)
April 2015 (2)
December 2014 (4)
October 2014 (2)
May 2014 (4)
February 2014 (1)
October 2013 (3)
April 2013 (1)
January 2013 (2)
August 2012 (1)
October 2012 (1)
July 2012 (3)
May 2012 (2)
January 2012 (2)
August 2011 (1)
July 2011 (2)
June 2011 (2)
May 2011 (2)
March 2011 (1)
February 2011 (1)
January 2011 (5)
December 2010 (1)
November 2010 (1)
December 2010 (1)
November 2010 (1)
October 2010 (1)
August 2010 (4)
July 2010 (2)
June 2010 (3)
May 2010 (2)
April 2010 (2)
March 2010 (2)