Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a bubble map using Leaflet JS. Everything is working smoothly (LeafletJS is awesome!) but now I'd like to try flannery compensation on the bubbles.

I can't find the math anywhere though. Best explainations I've been able to find say you have to multiply radius by either 1.4 or 1.8, which just seems a bit useless.

What is the math used for Flannery compensation?

share|improve this question
up vote 2 down vote accepted
Flannery Appearance Compensation case:
Pj = 1.0083 * (Valj/ValMin)^0.5716 * Pmin

Pj = point size of the j'th feature
Valj = value of the j'th feature
ValMin = minimum value
Pmin = minimum point size
^0.5 is to the power of 0.5 (square root)
^0.5716 is to the power of 0.5716 

More to be found at

share|improve this answer
Pmin seems to act more like a maximum point size, but it works. Thanks! – Martijn May 25 '14 at 14:48

I wrote up a little JS function based on @zimmi's formula that takes in a geojson, the name of the attribute, and the value for the minimum point size. Based on that it puts circles on the map.

var flanneryCompensation = function(geojsonName, attributeName, pMin) {
    // Creates a Flannery Appearence Compensation
    var geojsonLayer = L.geoJson(geojsonName);

    var valMin = Number.POSITIVE_INFINITY;;
    geojsonLayer.eachLayer(function (layer) {
        // Get minimum value of all features
        var value =[attributeName];
        if (value < valMin) valMin = value;

    geojsonLayer.eachLayer(function (layer) {
        var value =[attributeName];

        // Flannery Appearance Compensation case:
        pValue = 1.0083 * Math.pow(value/valMin, 0.5716) * pMin

        var circleLayer =, pValue);

A JSFiddle with some sample data:

share|improve this answer
The "^" is an XOR in javascript, so results were not as expected. Changing the actual Flannery line to pValue = 1.0083 * Math.pow(value/valMin, 0.5716) * pMin makes it work. – Martijn May 25 '14 at 14:42
@Martijn Cool, thanks for catching that. I updated my answer. – ustroetz May 25 '14 at 17:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.