0

I have a table containing info about countries and years, such as: * Country * Lon/lat (point) * Year * Value

For example

| Country | Year | Value
| UK | 2002 | 344
| UK | 2003 | 200
| UK | 2004 | 199
| Denmark | 2002 | 28
| Denmark | 2003 | 4044
| Denmark | 2004 | 388

I want to make a nice torque so I can visualize - year by year - it with bubbles. Big values=big bubbles.

I can't find how to do it. Have you any ideas?

2
  • First of all, are you seeing points on the map when you upload your file -- is CartoDB managing to find a recognizable geometry? Commented Mar 14, 2015 at 16:12
  • Yes, no problems with the points. The problem is how to set when the bubbles should be big vs small
    – Kristoffer
    Commented Mar 14, 2015 at 16:28

1 Answer 1

1

Duplicated: Carto DB: Scalable points over time using Torque in Carto DB

But, basically you need:

  1. Edit the torque-aggregation-function in the CartoCSS. From count(cartodb_id) to, for example, avg(your_value_column_name)

  2. Then, you'll be able to use the variable value that will be equal to the avg of the values that lay inside the aggregation region you've selected. Don't worry about this too much because your points seem separated enough so that they doesn't collide.

Example:

/** torque visualization */

Map {
-torque-frame-count:16;
-torque-animation-duration:10;
-torque-time-attribute:"time";
-torque-aggregation-function:"avg(value_column_name)";
-torque-resolution:2;
-torque-data-aggregation:linear;
}

#torque_sizes_ex{
comp-op: lighter;
marker-fill-opacity: 0.9;
marker-line-color: #FFF;
marker-line-width: 1.5;
marker-line-opacity: 1;
marker-type: ellipse;
marker-width:[value]/10 ;
marker-fill: #FF9900;
}

Of course, you can edit the rest of values as the frame-count, duration, etc as your convenience.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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