Michal Migurski's notebook, listening post, and soapbox. Subscribe to this blog. Check out the rest of my site as well.

Jun 26, 2012 2:39am

cascadenik in 2012

I went on a tear with Cascadenik in May and June, here are three cool new things you can do with it.

1. Use Mapnik 2

Artem, Dane and company have been diligently pushing Mapnik forward, and this spring saw the inclusion of Mapnik 2 in the newest Long Term Support version of the Ubuntu operating system, Precise Pangolin. Mapnik 2 has a variety of under-the-hood optimizations in stability and speed and an improved approach toward backward and forward compatibility, so it’s exciting to get Cascadenik back in synch with its host program.

2. Make Retina Tiles

Apple’s moving toward high resolution Retina display on all its hardware, and the usual doubling of old-resolution graphics can look pretty terrible. Cascadenik now has a built-in “scale” parameter, exposed as the “2x” flag to the compile script. You can painlessly double the resolution of an output and adjust all the scale rules, generating Retina-ready stylesheets at twice the visual resolution.

Retina version:

(both examples from OSM-Solar)

3. Write Concise Stylesheets

Carto picked up a few interesting features from Less-CSS, and Cascadenik now has versions of two of them.

Nested rules can simplify the creation of complex styles, making it easier to build up combinations of selectors over many sub-styles or zoom levels. Check out a particularly pathological example from Toner that shows how to separate general text attributes from zoom-specific ones. Cascadenik’s interpretation of Less is a bit stricter than Carto’s, which mostly just means that you have to add a few ampersands.

Variables are a simple way to group things like color or font selections in a single part of a stylesheet. While this isn’t something I use much of, it was an oft-requested feature and may make its way into Toner to enable simple customization. They work pretty much as you’d expect, taking on the precedence of where they’re used rather than where they’re defined.

I’m working with Nathaniel Kelso to identify other must-haves from Mapnik to include in Cascadenik, and as always focusing on stability and interoperability with other parts of the map building stack from data preparation tools like Dymo and Skeletron to eventual rendering and serving via TileStache.

October 2015
Su M Tu W Th F Sa

Recent Entries

  1. the bike rack burrito n’ beer box
  2. a historical map for moving bodies, moving culture
  3. the other openstreetmap churches post
  4. platforminess, smartness, and meaningfulness
  5. writing a new continuous integration service for openaddresses
  6. state of the map 2015
  7. bike ten: schwinn touring, v2
  8. blog all oft-played tracks VI
  9. 2015 fellowship reader
  10. bike ten: schwinn touring
  11. more open address machine
  12. open address machine
  13. making the right job for the tool
  14. the hard part
  15. end the age of gotham-everywhere
  16. on this day
  17. write code
  18. managers are awesome / managers are cool when they’re part of your team
  19. bike eight: french parts
  20. being a client