dorling.py

update: Here’s the dorling.py code, which is just a port of Danny Dorling’s C to Python. Remember, this only works with a particular topological input format (see county.in). I’ve done some more experiments with the circular cartogram algorithm: here, here, and most recently here.

Dr. Daniel Dorling was recently nice enough to provide me with some C sourcecode for producing his circular cartograms. And it works great! I’ve already ported it to Python and have consumed the result in Flash. Below is a screenshot of a circular cartogram of British population by county. That’s after 300 iterations of the algorithm, which took about 2 seconds.

dorling screenshot

Next step: getting the program to consume shapefiles/DBFs rather than its current proprietary format. This will work its way into something. Stay tuned!

One Comment

  1. This is an excellent example and I’d like to try to implement it for my data set. However, I’m having a hard time figuring everything out without the header file of your input file. Do you have that, or have you ever updated this script as you suggested you might? Thanks in advance.

    Ben
    Posted September 19, 2011 at 6:07 pm | Permalink

4 Trackbacks

  1. By indiemaps.com/blog » i got better on June 2, 2008 at 11:45 pm

    [...] talked about this before: Parts I & [...]

  2. [...] Part 2 of what will now be an ongoing series about my work with the Dorling circular cartogram algorithm; see part 1 [...]

  3. [...] with many other gems of quantitative geography). Dr. Dorling made Pascal and C code available. I ported it to Python, and began experimenting, mostly in vain, on a method that worked with a shapefile as input, but [...]

  4. By indiemaps.com/blog » Building topology in Flash on January 13, 2010 at 12:31 am

    [...] addition to knowing the neighbors of all features, Daniel Dorling’s original algorithm requires as input the shared border lengths of all contiguous features. These are used in the [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *