5 Open Data



1. Open Data – Visualization – Datafication – Sonification





Open Data: Sources

Our World In Data: https://ourworldindata.org/

Open Data Österreich: https://www.data.gv.at/

Beispiel "Tischtennis Wien": https://www.data.gv.at/anwendungen/tischtennis-wien/

Cincinatti: https://data.cincinnati-oh.gov/Efficient-Service-Delivery/Vehicle-GPS-Data-Department-of-Public-Services/b56d-ydmm

Taxi New York: https://data.cityofnewyork.us/Transportation/NYC-Taxi-and-Limousine-Commission-authorized-Dispa/2n4x-d97d



Retrieving data

People in space:

http://api.open-notify.org/astros.json

  JSONObject peopleData;
    JSONArray peopleNames;
    
    void setup() {
      peopleData = loadJSONObject("http://api.open-notify.org/astros.json");
      println(peopleData);
    }
    
    void draw() {
    
    }
    
      


Process JSON Data

People in space

  JSONObject peopleData;
  JSONArray peopleNames;

  void setup() { 
    size(600, 400);
    background(0);
    fill(255);
    textSize(40);
    peopleData = loadJSONObject("http://api.open-notify.org/astros.json");
    peopleNames = peopleData.getJSONArray("people");
    int number = peopleData.getInt("number");
    println(number);
    for(int i = 0; i < peopleNames.size(); i++){
      JSONObject person = peopleNames.getJSONObject(i); 
      text(person.getString("name"), 10, (i+1)*40);
    }
  }

  void draw() {
    
    
  }
        


Load CSV data / tables

Data set: https://www.data.gv.at/katalog/dataset/ogdlinz_wohnungen-wohnraeume28b1e/resource/bb8bb928-438b-403f-8b1f-283557d1f084


    


Mapping of processed data

Map

 import peasy.PeasyCam;

  JSONArray museumData;
  JSONArray cities;
  JSONArray peopleNames;
  PShape austria;

  int x,y, lastX, lastY;


  PeasyCam cam;

  void setup() { 
    size(1000, 600, P3D);
    colorMode(HSB);
    background(0);
    fill(255,150);
    noStroke();
    lights();
    //cities = loadJSONArray("citiesGPS.json");
    museumData = loadJSONArray("museumsDataAustria.json");
    cam = new PeasyCam(this, 400);
    //austria = loadShape("austria2.obj");
    lastX = 0;
    lastY = 0;
  }

  void draw() {
    background(0);
  // shape(austria, 0, 0);
    for(int i = 0; i < museumData.size(); i++){
      JSONObject museum = museumData.getJSONObject(i); 
      float lat = museum.getFloat("Latitude");
      float lon = museum.getFloat("Longitude");
      String address = museum.getString("Adresse");
      
      x = int(map(lon, 10.735005, 16.936047, 0, width))+1;
      y = int(map(lat, 46.519382, 48.91616, 0, height))+1;
      
      pushMatrix();
        translate(x,y);  
        noStroke();
        fill(x*0.5, 100, 255,100);
        sphere(4);
        stroke(x*0.5, 255, 255,100);

        strokeWeight(2);
        line(0,0, 0, 0, 0, 30);
      popMatrix();

      strokeWeight(1);
      line(x,y, 30, lastX, lastY, 30);
      lastX = x;
      lastY = y;
    }
  }
      

Assignment 1
Find an open data set from one of the given websites (or from elsewhere), analyze it, use the data for a abstract visualization in Processing.





Final project
"Metamorphosis"