Code for GPS Viz

//Get GPS data from CSV
import processing.opengl.*;

float maxLong=-75.8268966675;
float minLong= -75.692741394;
float minLat= 6.33245897293;
float maxLat= 6.57979154587;
float maxAlt= 1754.02160645;
float minAlt= 452.191711426;

float valuex;
float valuey;
float valuez;
float l;
float rotX;
float rotY;

Table table;

void setup() {
 size(1280,720,OPENGL);
 table = loadTable("santafe.csv", "header");

 println(table.getRowCount() + " total rows in table"); 
 //strokeWeight(4);
 //stroke(255,0,0);
 noStroke();
 fill(234,103,2);
 noCursor();
 }
void draw(){
 lights();
 background(2,234,139);
 rotateY(rotX);
 rotateX(rotY);
 //rotateX(mouseY*0.03);
 
for (TableRow row : table.rows()) {
 
 //int id = row.getInt("id");
 float altitude = row.getFloat("alt");
 float latitude = row.getFloat("lat");
 float longitude = row.getFloat("lon");
 
 
 
 valuex=map(latitude,minLat,maxLat,100,width);
 valuey=map(longitude,minLong,maxLong,300,height);
 valuez=map(altitude,minAlt,maxAlt,0,200);
 println(altitude);
 
 pushMatrix();
 translate(valuex-300,valuey-300,200);
 box(5,valuez,5);//bars
 sphere(3);
 popMatrix();
 
 }
}

void mouseDragged()
{
 rotX += (mouseX-pmouseX) * 0.01 ; //150-600
 rotY -= (mouseY - pmouseY) * 0.01;
}

 

santafe