Sketchy Maps with Geometry Smoothing
New Mapnik feature can be used for a hand drawn effect
Recently I posted about how I’ve been experimenting with new Mapnik features in TileMill. This past weekend at the Mapnik code sprint here in DC, I experimented with its new geometry smoothing feature that rounds the corners of polygons and lines and can be useful for making low-resolution data look reasonable at larger scales. Passing it values between 0 and 1 will create bezier curves that smooth shapes to various degrees.
It’s also possible to pass the style values greater than 1, at which point the beziers start to loop back on themselves and things get a little crazy. A ‘sketchy’ look to lines can be achieved by overlaying a number of line attachments with different smoothing values applied.
Here I’m smoothing by 5, 10, and 20, and the lines are overlaid using the ‘multiply’ compositing operation. This make areas that overlap more appear darker.
As an experiment I combined line smoothing with textures, compositing operations, and a script typeface to design a hand-drawn, weathered-looking world map.
These features are still in development, but will be available soon in TileMill.