Skip null values for quantification methods generating null values

This commit is contained in:
Raul Ochoa 2016-07-04 02:15:54 +02:00
parent 746d57ff42
commit 98cd524c07

View File

@ -84,6 +84,10 @@ PostgresDatasource.prototype.getRamp = function (column, buckets, method, callba
var strategy = method2strategy[methodName];
var ramp = result[0][methodName] || [];
// Skip null values from ramp
// Generated turbo-carto won't be correct, but better to keep it working than failing
// TODO fix cartodb-postgres extension quantification functions
ramp = ramp.filter(function(value) { return value !== null; });
if (strategy !== STRATEGY.EXACT) {
ramp = ramp.sort(function(a, b) {
return a - b;