How to create faster-drawing maps

Here's how to draw maps as fast as possible, especially when zoomed out.

Use the latest CTM1 format, and use version 2 of the OSM-to-CTM1 rules. All you need to do is put these options at the start of your makemap command line:

makemap /v=5 /rules=2 /lowreslayers=yes

If you create a CTM1 file with the new rules you can use either of the standard style sheets, osm-style.xml and osm-neo-style.xml. They contain layers for both sets of rules

(/rules=1 (the default) and /rules=2)

How it works

  • Version 5 (/v=5) of the CTM1 format uses a more efficient method of spatial indexing in the CTM1 file.
  • The new OSM-to-CTM1 rules arrange the layers in a different way that avoids reading thousands of irrelevant objects when zoomed out.
  • It's important to use /lowreslayers=yes to take advantage of this system: you need to create simplified data for use when zoomed out.

The new layer name convention

The new layer names use a new convention. Any group of layers which represent the same map objects, but at different scales, uses names structured rather like file paths:

road/major
road/mid
road/minor
amenity/major
amenity/minor
etc.

CartoType makes use of this convention in two ways:

Implicit layer grouping in style sheets. If a layer is specified in a style sheet, that layer and all layers 'under' it are drawn. Thus, in the new style sheet, the place/major and place/minor layers are referred to individually using <layer name='place/major'> and <layer name='place/minor'> at the start, and collectively as <layer name='place'> at the end.

Wild-card layer searching. The CartoType API now supports wild cards when specifying layers in the Find and FindText functions. The common wild-card characters * and ? are supported, and there is also a special convention that strings ending in '/' search for the layer (without the trailing '/') and any layers under it.