In Carto (CartoDB), is it possible to change the category classifications in “Torque Cat” to be qualitative instead of categorical, as you would have in the “Choropleth” map? Both the values and the legend representation. Basically I want to animate the representation we get from the choropleth wizard.
I’m working on a simple animated map of points over time for drone locations and I want the animation to change the point and trail colors according to a field with values for the drone roll or pitch at each location. I've attempted to port over the CSS from the choropleth map to the torque cat map but not getting the results I want.
updated to add my modified code as applied from answer below:
/** torque visualization */
Map {
-torque-frame-count:512;
-torque-animation-duration:30;
-torque-time-attribute:"serialdate";
-torque-aggregation-function:"sum(pitch)";
-torque-resolution:2;
-torque-data-aggregation:linear;
}
#seacharger_ca_hi_10kmjoin{
comp-op: source-over;
marker-fill-opacity: 0.9;
marker-line-color: #FFF;
marker-line-width: 0;
marker-line-opacity: 1;
marker-type: ellipse;
marker-width: 6;
marker-fill: #0F3B82;
}
#seacharger_ca_hi_10kmjoin [ value <= 12] {
marker-fill: #41b6c4;
}
#seacharger_ca_hi_10kmjoin [ value <= 6] {
marker-fill: #7fcdbb;
}
#seacharger_ca_hi_10kmjoin [ value <= 0] {
marker-fill: #ffffcc;
}
#seacharger_ca_hi_10kmjoin [ value <= -7] {
marker-fill: #FFCC00;
}
#seacharger_ca_hi_10kmjoin [ value <= -14] {
marker-fill: #FF9900;
}
#seacharger_ca_hi_10kmjoin [ value <= -21] {
marker-fill: #FF6600;
}
"sum(pitch + max)"
(or better"avg(pitch + max)"
), wheremax
is the maximum value from thepitch
column (you can get this value applying the following query:SELECT max(pitch) FROM seacharger_ca_hi_10kmjoin
.avg
(or maybesum
) instead ofcount
. But this is the only way to style it as a choropleth. So if you think your question has been solved, please mark it as answered.count
doesn't eliminate them. But the switch to choropleth seems to have worked, thanks!