How is the Gastner-Newman equation implemented to create value-by-area cartograms?

212 Views Asked by At

There is a paper called "Density-equalizing map projections: Diffusion-based algorithm and applications" by Michael T. Gastner and M. E. J. Newman, which explains their algorithm for generating value-by-area cartograms.

While it explains the theoretical side of the mathematics involved with their algorithm, it doesn't explain how they actually implemented it. I tried to piece it together by looking at the source code from cart, but I don't have the programming knowledge (it's written in c, which I don't know) required to understand it.

If anyone has at least a decent understanding of it and can explain the steps needed to create a cartogram using their algorithm, that would be greatly appreciated. Otherwise, if you have other helpful resources on the topic, those would be good too.

1

There are 1 best solutions below

0
On

General outline

  1. You need to have two-dimensional input scalar data as the initial population density.
    If you already have data in this format, you can go to the next step.

  2. You need a computational domain on which density is evaluated at different time $t$.
    The general solution to the time-dependent diffusion equation has a discretization, which can be calculated using Fourier transform packages such as FFTW. The boundary condition is chosen to be rectangular for this particular reason.

  3. You then displace boundary of your regions and stop until some stopping criterion is met.
    The classical 4th-order Runge-Katta is an option, and I think Rcartogram uses Runge-Katta of an even higher order. The velocity of every point on your border can be calculated using output from step 2.