Levels of map objects
Most mapped objects are at ground level, but often it is useful to distinguish between various vertical levels, to allow the map to display objects in layer order.
CartoType uses 16 different levels. Ground level is 0, lower levels range from -8 (lowest) to -1, and higher levels range from 1 to 7 (highest).
Levels of map objects
The level is stored in the FeatureInfo attribute of a map object, which has an attribute called Level. The level of an object cannot be changed in the style sheet, but may be tested in a style sheet expression by using the special variable @level.
Drawing order
Levels affect the drawing order in quite a complicated way, but the order is designed to create a map that is as natural and easy to understand as possible.
Step 1: draw all objects in layers earlier than the road layer, so that roads, railways, etc., can be drawn over parks, rivers, etc., even if sub-surface.
Step 2: draw all other underground objects (levels less than zero) for the road layer and later layers.
Step 3: draw the surface-level objects for the road layer and later layers.
Step 4: draw all elevated objects (levels greater than zero), for the road layer and later layers.
Within each step, objects are drawn in level order, lowest first. Within each level, objects are drawn in layer order, as the %lt;layer%gt; elements occur in the style sheet. Within each layer, objects are drawn in %lt;condition%gt; order, as the conditions occur in the style sheet.