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):
<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:
<highlight distance='0' fill='~color~' width='0.5m'/>
<highlight distance='-16.66%' fill='~color~' width='0.5m'/>
<highlight distance='16.66%' fill='~color~' width='0.5m'/>
<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'/>
<label case='upper' color='dimgrey' duplicate='1000m,256pt' font-size='75%,5pt,18pt' glow='white' glowWidth='7%,0.5pt' labelFormat=';'/>
<label baseline='central-caps' color='dimgrey+0.25white' condense='no' duplicate='1000m,256pt' font-size='90%,5pt,18pt'
<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
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....
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....
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....
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:...