Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created December 17, 2012 16:33
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tmcw/4319642 to your computer and use it in GitHub Desktop.
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