Saturday, December 21, 2013

"Bosatlas" style for Google Maps

The Bosatlas, originally published in 1877 and now in its 54rd edition, is the map book everyone in the Netherlands knows from geography class. Entire generations grew up with the color scheme it uses for maps of the country; its orange cities, mauve industrial areas, and ruby highways and borders are deeply etched into the national soul. But now that Google Maps is usually the quickest way to see a map, do we have to settle for its bland colors?

One thing that has slightly bothered me about Google Maps is that it doesn't really offer a good topographical map. Satellite images are nice, of course, but can sometimes be surprisingly hard to read. And the "Map" mode is more of a road map than a topographical map: The road network stands out, but terrain is represented in very light and washed out colors. Because of this, it can actually be pretty hard to tell cities and agricultural land apart.

So that is why I used the Google Maps API to make a custom map style emulating the color scheme of the Bosatlas. Try it out here, or see the image below for a comparison between my style (top) and the default (bottom), and here for a picture from an actual Bosatlas.

Some differences I am aware of:
  • The Bosatlas has different colors for pastureland and crops. It appears Google doesn't have this information
  • Same for the Bosatlas' yellow dunes and pink heath, and fresh vs salt water.
  • Railway lines only become visible at a certain zoom level in Google Maps. Ideally, they would also show in the map below, but it appears this currently isn't possible.
  • It would also be nice if I could underline provincial capital names, and style A-roads (primary motorways) differently from N-roads.
  • Similarly, tram lines are treated the same as the major rail network, while they shouldn't be visible at all.
  • I would like to show National Parks and other forests in the same shade of green, but haven't found how to do that.
  • Dikes are missing!
So what do you think? :) If you're interested, you can find a javascript function with the style I used here. Feel free to reuse it.

Tuesday, April 23, 2013

Some artificial datasets for machine learning

Interested by a question on StackOverflow, I made a set of Matlab functions that generate a variety of artificial datasets that can be used to test Machine Learning methods. Which classifier does well on the Two Spirals problem? What causes some classifiers to fail on this or that problem? It's often useful to have some datasets available that can be challenging to an algorithm although the pattern is quite clear to a human, and artificial datasets provide just that.

Below is some example output of the six functions with default parameters. They can all be customized with regards to number of instances, noise, scale, etc. You can download the functions (including a demo) from my website.

Thursday, June 28, 2012


I'm working on a Stratego game for a course on Game Programming. This is what it currently looks like:

The interface and basic controls are coming along nicely, so I will soon be able to direct my attention to the best part: killer AI! And if there's some time left, I have plenty of ideas for changing and extending the rules and possibilities of the classic game.

Monday, May 21, 2012

Star Trek timeline

After doing a small update to my 'Spacerocks' page recently, I took the time to revisit another scifi themed project, a Star Trek timeline I made a few years ago (the old one can be found here). I completely redid it, and this time around I decided to write a Python script that would do all the math and draw the image for me using a database of series and movies, instead of messing around with counting pixels in Photoshop.

The top bar is our actual time, and the bottom bar is the in-universe years that are portrayed in the Star Trek productions. I thought there weren't any other time lines that visualized the Star Trek universe in such a way, but I just discovered a fairly similar one. Oh well.

Click to enlarge.

If you've seen any other instances of double timelines linking real and fictional histories, I'd really like to see them :)

Monday, March 12, 2012


Last week I made a simple little program that keeps track of your active window. The idea was that knowing how much time you waste would help in getting back to work.

Of course, now I first need to win back the time I wasted on programming this...

Anyway, it has super cool pie charts and you can get it here if you're interested.

Tuesday, January 24, 2012

Random Thought

Can you be "fluent" in a programming language? Or does fluency require you to speak it?

Friday, November 4, 2011

AI Challenge

AI Challenge is an interesting, Google-sponsored multi-agent systems contest, that looks a lot like a competition held for a course I followed last year. Up to 8 teams of ants are pitted against each other on random maps, and have to explore, gather food and must plan and cooperate intelligently to defeat their rivals.

I was really compelled to join the competition, but rather late to discover it. Moreover, I was just too busy with other work. Maybe next time!

Friday, May 6, 2011

Euler Project

Problem 19: How many Sundays fell on the first of the month during the twentieth century?
Problem 24: The lexicographic permutations of 0, 1 and 2 are:
012 021 102 120 201 210

What is the millionth lexicographic permutation of the digits 0,1,2,3,4,5,6,7,8 and 9?
Problem 60: The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of these four primes, 792, represents the lowest sum for a set of four primes with this property. 
Find the lowest sum for a set of five primes for which any two primes concatenate to produce another prime.
Just some examples of questions posed by Project Euler, a list of 373 mathematical programming exercises (and counting).

Some are quite challenging, some are rather easy. But with the easier ones it's often still fun to find a solution that's nice and efficient. And a 'good' solution should give the answer in less than a minute. The number of Sundays in the 20th century, from the example above, happens to be *very* simple to approximate accurately, by just taking 1/7th of the total number of days.

I challenged myself to solve them all in one month. So far I've been working in Python, but maybe I can use this as an excuse to learn some new languages. Current status: 22 down, 314 to go!

Update November 2011: Well, one month was just a little overoptimistic. But I've made slow but steady progress, having currently solved nearly a hundred problems. They do get a lot more difficult than the examples I gave though.