night mode

CartoType now has a night mode which can be turned on and off using the new SetNightMode function.


Here's how you can add lane dividers to roads on your map. There are two things to do: first, you need attributes in the road data stating how many lanes there are, and second, you need to use that information in your style sheet to draw narrow lines on the roads.

Add lane information to the map

You should add an attribute called _lanes to the data. The attribute name starts with an underscore to prevent it being part of the full-text index. For OpenStreetMap data you could create a custom import script (a .makemap file) with this line added to the highway section (shown in context):

<group test='highway'>
        <set_level value='layer'/>
        <if test='@way'>
                <set name='_lanes' value='lanes'/>


Remember, you can create custom import scripts by exporting the script using makemap -writerules >myfile.makemap, then editing the file that was written.

Add the new .makemap file to your makemap command line, before any files it should affect. Example:

makemap lanes.makemap cambridge.osm /project=osgb /urbanareas=yes /extent=0.05,52.16,0.2,52.24

Tell the style sheet to draw the lane dividers

Now add a macro to draw line dividers to your style sheet. Here's an example which handles 2, 3 and 4 lanes:

<macro id='lanes'>
    <condition exp='_lanes==2'>
        <highlight distance='0' fill='~color~' width='0.5m'/>
    <condition exp='_lanes==3'>
        <highlight distance='-16.66%' fill='~color~' width='0.5m'/>
        <highlight distance='16.66%' fill='~color~' width='0.5m'/>
    <condition exp='_lanes==4'>
        <highlight distance='-25%' fill='~color~' width='0.5m'/>
        <highlight distance='0' fill='~color~' width='0.5m'/>
        <highlight distance='25%' fill='~color~' width='0.5m'/>

Use the macro where suitable. For example, you could use it in your motorway style like this:

<condition exp='RoadType == "motorway"'>
    <line border='dimgrey' borderWidth='8%,0.35pt,1pt' fill='orange+0.03black+0.2white' width='12m@6000_100m@75000,0.75pt'/>
    <scale max='75000'>
        <label case='upper' color='dimgrey' duplicate='1000m,256pt' font-size='75%,5pt,18pt' glow='white' glowWidth='7%,0.5pt' labelFormat=';'/>
    <scale max='6000000'>
        <label baseline='central-caps' color='dimgrey+0.25white' condense='no' duplicate='1000m,256pt' font-size='90%,5pt,18pt'
            font-weight='bold' labelFormat='{[padding:20%,0.6pt;background-color:orange+0.5white;border-color:dimgrey+0.25white;border-width:12%,0.7;border-radius:50%,1.2pt}ref{]}'
            wrapLines='0' wrapWidth='30em'/>

    <macro ref='standard-bridge'/>
    <macro ref='standard-tunnel'/>
    <macro ref='lanes' color='darkgrey'/>

Here are some lane dividers drawn using this style.




It's sometimes useful to have a base map of the world on which you can overlay more detailed maps. It's impractical to create a fully detailed map of the world - it would be too large and makemap would take too long to run - but it's quite easy to create a world map containing coastlines, major administrative boundaries, and major roads only.



This map shows how far you can drive from the center of Perth, Scotland in ten minutes (dark yellow area) and twenty minutes (light yellow area). It was created using CartoType's Range function, which creates a polygon enclosing the area reachable in a certain time, or within a certain distance.


Here is a worked example, from start to finish, showing how to create a map from OpenStreetMap data with the following features:

  • urban area shading
  • terrain shading
  • heights in metres
  • contour lines
  • coastlines
  • routing

The map is of part of Scotland including Perthshire. For the purpose of making a simple example, the bounds of the this map are on lines of longitude and latitude, from 3 to 5 degrees west and from 56 to 57 degrees north.


Qt is one of the most popular cross-platform application frameworks. It's easy to integrate CartoType into a Qt application. Qt-compatible CartoType libraries are shipped with the Windows and Linux SDKs.


Here's a list of features we've added to CartoType since the start of 2014. If you last looked at CartoType a while ago, it might interest you to see how much is new, and how much has been improved.


The traffic information functions allow you to set speed limits or prohibitions for areas or individual roads. These items of traffic information are used by the routing system to create modified routes. They can be added or removed at run-time, thus supporting the use of dynamic traffic information.


You can get regular CartoType news by subscribing to the CartoType newsletter via our contacts page. You can access previous newsletters here.

three d buildings1

You can import and draw buildings in either 3D perspective, as shown above, or an orthographic '2.5D' view as shown below.



There's a FindAddress function that takes a structured address parameter object, which has fields for house number, street, city, postal code, etc.. Here's what it looks like in all 4 APIs:


There is an SQL map data format intended mainly for data added and modified at run time. CartoType's main map data format is CTM1, which is versatile, compact and fast, but not modifiable: every time you need a new CTM1 file you have to create it from scratch - usually from OSM data.


varying terrain shading

You can use the makemap tool to create hill shading, and you can control its appearance in detail if you like.


CartoType's standard routing system is sometimes not usable for large areas (any area with a population of more than 30 million, in practice) on the Android and iOS platforms, because the whole route network is loaded into memory.


curved label box

This label containing the road number 21 and the name Forrest Hill Road, was specified in the style sheet using a type of label format which allows you to insert boxes with background colors and borders. Boxes can be nested if you like. The road name is aligned with the road and curves round it, while the label sits in its own box above.


clipper down walk

CartoType supports writable map data, which means that unlike CTM1 maps it can be changed, edited and created at run time. Another name for this functionality is dynamic data. You can add map objects at run time,and you can make the data persistent by writing it to a file.



Here's a map showing the world's coastlines using the spherical Mercator projection ("web Mercator"). You can load extra maps very easily using the CartoType framework's LoadMap function; the only requirement is that the extra maps have the same projection and resolution, which in this case is one map unit per projected meter. I made these images using the Cartotype Windows demo, which has the option 'Open in current map...' in the File menu.

First I load a map of Greece and zoom in to show that it's really there:


Here's a CartoType map of the islands of north west Scotland:

cartotype hebrides

All the major islands are named. In contrast, OpenStreetMap, using the same data, omits the names:


neo style 0

There's an alternative to the standard style sheet: osm-neo-style.xml. It has a calmer and more subdued look. It's completely compatible with osm-style.xml, so you can experiment with it using the same map data and switch between the two freely.


The tool for creating CartoType maps, makemap, has a command line option /route=yes which causes it to pre-calculate the route network and store it as part of the CTM1 file. This option is the default.