VS Stormschade meldingen
Op 9 nov 2007 ben ik bezig geweest met het zoeken naar CSV bestanden op internet met daarin LON LAT coordinaten en tijd. M’n plan is om die data te verzamelen en weer te geven op een kaart. Dat heb ik gedaan voor stormschade meldingen in de VS en wat je ziet is dan een kaart die door de tijd verandert en waarbij je eigenlijk precies met een beetje fantasie windrichtingen kunt zien. Echt heel vet en super makkelijk. Wellicht interessant voor Globe4D.

Stel je dit voor als een animatie waarbij de meldingen een voor een binnendruppelen in een soort van sliert door het land heen.
Sourcecode
Node.pde
class Node {
Node next;
String ini;
String time;
float speed;
String location;
String county;
String state;
String comments;
float lat;
float lon;
int x;
int y;
int r;
int time_hour;
int time_minute;
Node(String ini) {
//this.ini = ini;
String items[] = split(ini,",");
time = items[0].substring(0,2) + ":" + items[0].substring(2);
time_hour = int(items[0].substring(0,2));
time_minute = int(items[0].substring(2));
speed = int(items[1]);
r = int(speed/5);
if (r<1) r=1;
location = items[2];
county = items[3];
state = items[4];
lat = float(items[5]);
lon = float(items[6]);
int sc = 7;
x = int(lon*sc + 180*5);
y = int(lat*sc);
}
}
CSV_Test_1.pde
import processing.opengl.*;
PFont font;
PImage bg;
Node first;
Node cur;
Node last;
int speed=1; //draw 40 dots per frame
void setup() {
//Time,Speed,Location,County,State,Lat,Lon,Comments
String lines[] = loadStrings("060622_rpts_wind.csv");
println("there are " + lines.length + " lines");
font = loadFont("AvantGardeITCbyBT-Demi-30.vlw");
textFont(font, 30);
first = new Node(lines[1]);
cur = first;
for (int i=2; i < lines.length; i++) {
cur.next = new Node(lines[i]);
cur = cur.next;
}
cur = first;
size(800,600);
//colorMode(HSB,255);
//background(0);
//stroke(255);
smooth();
//image(bg,0,0);
}
void draw() {
fill(0,10);
noStroke();
rect(0,0,width,height);
noFill();
stroke(255);
for (int i=0; i<speed; i++) {
ellipse(cur.x,cur.y-100,cur.r,cur.r);
cur = cur.next;
if (cur==null) cur=first;
}
int ox=-700;
int oy=100;
int x=cur.time_hour*60 + cur.time_minute;
println(ox+x);
line(ox+x,oy,ox+x,oy+5);
fill(0,150);
noStroke();
fill(0);
rect(0,0,200,50);
fill(255);
text(cur.time, 30, 30);
}
060622_rpts_wind.csv
Time,Speed,Location,County,State,Lat,Lon,Comments 1222,UNK,LEWISTOWN,FULTON,IL,40.4,-90.16,TREE LIMBS DOWN. (ILX) 1302,60,PEKIN,TAZEWELL,IL,40.57,-89.63,(ILX) ......
Reageer op dit bericht / Leave a message
Vrijdag 28 september is er spectaculaire opendag bij 





Today, Monday the 3rd of July 2006 was really an amazing day! First, this morning RTV West visited our workspace for a documentary they make about our Globe4D project. And second, we got a positive response from the ACM Multimedia Conference 2006 in California!!! This means Globe4D will be part of the exibition in October!

