Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
MapCSS vs CartoCSS

In which I begrudglingly compare MapCSS and CartoCSS because people keep asking.

I hate this kind of writing - it's annoying to try to describe one bit of software versus another, and this can and will fall out of date every time that somebody makes a big change to their library. But people want it, or whatever, so here it is.

Since CartoCSS and Cascadenik are weird cousins, the big difference is between them and MapCSS.

Let's see, differences:

  • CartoCSS is designed for Mapnik. That is, it tries to expose every possible Mapnik style option and ability, and supports every Mapnik datasource.
  • MapCSS is designed for OSM. That is, it makes it easy to style based on OpenStreetMap data types, tags, and so on.
  • CartoCSS inherits some syntax and functionality from less, giving it nesting, functions, and so on.
  • CartoCSS and MapCSS both try to have specifications, and neither is complete. MapCSS has more implementations, but they have varying abilities. CartoCSS has two implementations, only one mature, but there's a strong guarantee of styles working.
  • MapCSS includes an eval function, and has rules that act as 'commands' to modify data. CartoCSS does not support eval or any data-modifying operations.
  • The main CartoCSS parser is implemented in Javascript for nodejs, while the main MapCSS parser is implemented in ActionScript.

And similarities:

  • Both are liberally licensed open specifications
  • Both can target Mapnik in some way
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment