CartoCSS style for Standard tile layer
- Main article: Standard tile layer
CartoCSS is used in the rendering process of the "Standard" map tiles of OSM.org since August 2013. The "openstreetmap-carto" CartoCSS stylesheet is maintained at https://github.com/gravitystorm/openstreetmap-carto. Bug reports (e.g. rendering problems of specific object classes) can be raised there (needs a login with a github.com account).
CartoCSS stylesheets differ from MapCSS in a number of ways: the most important being that the underlying data representation is not tied to OSM data or any other datasource. They also aim to expose as much Mapnik functionality as possible, be compilable very quickly, and have advanced features like variables, attachments, and filters that can be gradually applied.
Though CartoCSS stylesheets can work with any data structure, an 'OSM' carto stylesheet based off of one schema, like Imposm or HighRoad, can be swapped with another stylesheet based on the same schema.
Mapbox considers Mapbox GL to be replacement of CartoCSS, despite that CartoCSS is still actively maintained by the community.
The MML file is a YAML or JSON file containing layer definitions and stylesheet references. It is the central part of a CartoCSS stylesheet.
MML files can be converted to Mapnik XML with the carto command as follows:
carto project.mml > mapnik.xml
assuming that you have installed carto via NPM. Otherwise, if you're using Tilemill you can also use it's bundled carto executable (which can be found in
- cartocss-doc-parser for Python
- Cartoshka for Java
- Magnacarto has its own CartoCSS parser written in Go
- MapSurfer.NET-CartoCSS for C#
- List of CartoCSS projects, map styles using CartoCSS
- CartoCSS vs MapCSS