mercredi 25 mars 2015

CartoDB: How to I cluster by features? Is it even possible?


I have a set of points for a number of buildings in NYC. I would like to group those points into clusters per their respective neighborhood (ex: Chelsea, Upper East Side etc.). Each of my points have a designated neighborhood.


Is there a way to tweak the CSS to make it happen? I don't quite understand how the Wizard is currently clustering my points:



/** cluster visualization */

#data{
marker-width: 12;
marker-fill: #FD8D3C;
marker-line-width: 1.5;
marker-fill-opacity: 1;
marker-line-opacity: 1;
marker-line-color: #fff;
marker-allow-overlap: true;

[src = 'bucketE'] {
marker-line-width: 5;
marker-width: 24;
}

[src = 'bucketD'] {
marker-line-width: 5;
marker-width: 34;
}

[src = 'bucketC'] {
marker-line-width: 5;
marker-width: 44;
}

[src = 'bucketB'] {
marker-line-width: 5;
marker-width: 54;
}

[src = 'bucketA'] {
marker-line-width: 5;
marker-width: 64;
}
}

#data::labels {
text-size: 0;
text-fill: #fff;
text-opacity: 0.8;
text-name: [points_count];
text-face-name: 'DejaVu Sans Book';
text-halo-fill: #FFF;
text-halo-radius: 0;

[src = 'bucketE'] {
text-size: 12;
text-halo-radius: 0.5;
}

[src = 'bucketD'] {
text-size: 17;
text-halo-radius: 0.5;
}

[src = 'bucketC'] {
text-size: 22;
text-halo-radius: 0.5;
}

[src = 'bucketB'] {
text-size: 27;
text-halo-radius: 0.5;
}

[src = 'bucketA'] {
text-size: 32;
text-halo-radius: 0.5;
}

text-allow-overlap: true;

[zoom>4]{ text-size: 16; }
[points_count = 1]{ text-size: 0; }
}


Thank you for your help.





Aucun commentaire:

Enregistrer un commentaire