4

My understanding of choropleth maps that use the quantile method is that they will assign an equal number of items to each bucket (see http://www.ncgia.ucsb.edu/cctp/units/unit47/html/comp_class.html).

A recent map I made with CartoDB generated a map that did not do this. Instead, most items were assigned to one bucket. Choropleth Map Example

Is CartoDB using a different type of quantile method than what I described?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338

1 Answers1

4

Choropleth is using equal interval I believe. You can calculate the numbers for a couple different algorithms on your own by using some SQL helper functions we made (https://github.com/CartoDB/cartodb/wiki/CartoDB-PLpgSQL#wiki-statistical-functions). Then just use those results in your CartoCSS defined bins.

Doing it on the fly might take a bit of work in cartodb.js, but that should get you started.

andrewxhill
  • 2,468
  • 12
  • 17
  • We tried API query described in GitHub. It returned an error when we tried it with decimal values, but worked with integer values. Is this a possible explanation for why quantile would generate strange looking maps? Also - the default in CartoDB for choropleth is equal interval, but there is an option for quantile. When we choose quantile CartoDB generates a map like the one image, which could be due to the possible decimal issue? – Nathan Storey Jan 27 '14 at 22:13
  • But ... the choropleth wizard has a "quantification" pulldown that lets you select from Jenks, Quantile, Equal Interval and Heads/Tails. So one ought to be able to adjust the quantification and see that reflected on the map. – Amanda Jan 28 '14 at 18:59