Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] cities;
- Table table;
- TableRow row;
- int frms = 60, step, c=0;
- void setup() {
- size(540, 270);
- background(0);
- table = loadTable("cities.csv", "header");
- step = table.getRowCount()/frms;
- }
- void draw() {
- translate(-270, -200);
- scale(4.5);
- if (frameCount<=frms) {
- for (int i=c; i<c+step; i++) {
- row = table.getRow(i);
- float lat = row.getFloat("lat");
- float lng = row.getFloat("lng");
- setXY(lat, lng);
- }
- c += step;
- }
- if (frameCount<=frms+30) saveFrame("image-###.gif");
- }
- void setXY(float lat, float lng) {
- float sz = 0.25;
- float x = map(lng, -180, 180, 0, width);
- float y = map(lat, 90, -90, 0, height);
- fill(255, 150);
- noStroke();
- ellipse(x, y, sz, sz);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement