Twitter icon.
Random notes on software, programming and languages.
By Adrian Kuhn

ZIP Code Map of Switzerland

Inspired by Robert Kosara’s US ZIP Scribble Map as well as Stefan Zeiger’s ZIP Code Map of Germany, I’ve done a small script that renders Switzerland as a ZIP code map.

Edit: obviously, Robert Kosara has also done a ZIP scribble map of Switzerland, but it is broken. On the US original he explores the correlations of 1000-blocks of ZIP codes and state boundaries. On his Swiss map however, he directly groups the lines by cantons! Which is obviously not the same since we have 26 cantons but only nine blocks of 1000 ZIP codes.

In particular interesting is how the red and brown ZIP code blocks are dividing the canton Valais by its two languages: French and German! (For foreigners: the valais is the huge valley in the south-east which is covered half by red lines and half by brown lines.)

The script is written in Pimon, a small visualization framework for VW Smalltalk. Of course, Pimon has a DSL! The layout- and drawing DSL of Pimon offers a fluent interface that targets the end-users of common Desktop applications. Figures are grouped, aligned and positioned as you would do it in an Desktop application, rather than forcing the programmer to wrap his head around vector algebra with all its x’s and y’s.

The following bunch of Pimon code specifies a tree layout (the same in Java):

TreeLevel >> arrange
    | group |
    group := Group new
        addAll: self treeChildren;
        horizontalWithGap: 4;
    Group new
        add: self treeParent;
        add: group;
        verticalWithGap: 16;
    self resizeToElements.

I started porting Pimon to Java last year, but only got 80% done and thus never released it to the public. However, it is sad to let code decay without being used and maybe the parts that are working turn out to be useful for your projects, thus I published it today:

One Response to “ZIP Code Map of Switzerland”

  1. Robert Kosara Says:

    Neat! But you’re wrong about the US map, the maps are all colored by state or province, not by numerical zip code. That wouldn’t even work for some countries that have alphanumeric postal codes, like the UK.

    Having said that, I’ve been thinking about doing maps that show the numerical regions in a hierarchical way, I just haven’t found a good way of doing that - one that is visually pleasing and yet shows a lot of information.

For.example is Digg proof thanks to caching by WP Super Cache!