tecznotes

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.

Comments

Sorry, no new comments on old posts.

May 2016
Su M Tu W Th F Sa
    

Recent Entries

  1. five-minute geocoder for openaddresses
  2. notes on debian packaging for ubuntu
  3. guyana trip report
  4. openaddresses population comparison
  5. blog all oft-played tracks VII
  6. week 1,984: back to the map
  7. bike eleven: trek roadie
  8. code like you don’t have the time
  9. projecting elevation data
  10. the bike rack burrito n’ beer box
  11. a historical map for moving bodies, moving culture
  12. the other openstreetmap churches post
  13. platforminess, smartness, and meaningfulness
  14. writing a new continuous integration service for openaddresses
  15. state of the map 2015
  16. bike ten: schwinn touring, v2
  17. blog all oft-played tracks VI
  18. 2015 fellowship reader
  19. bike ten: schwinn touring
  20. more open address machine

Archives