How to display files column by column?

Hi, I’m very beginner. I really need your help.
(Eventhough I used a library, the question is not about the library itself. The main question is a code regarding how to read files (column by column)and display it in sequence.)
My project is…‘animation of hourly activities on map’.

  1. To display amount of hourly activities on map. (On the same day, and the amount of activities will be described as circle size)

  2. When I finish displaying activities(points) for time 0(T1), then now need to display points for time1(T1)…and so on(for time 2(T2), time 3(T3), time 4…) It should be an ‘animation’

  3. the result needs to be “animation” which shows the changes of activities on the same points on the map over time(hourly)

The structure of CSV(which includes the information of location, amount of activities, time and date) file is as follow

I’ve tried to display for the first day of first time(T0) by using this code below.

// we should load all things in setup, and call each one and draw in draw() in order.

import com.reades.mapthing.*;
import net.divbyzero.gpx.*;
import net.divbyzero.gpx.parser.*;
import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.geo.*;
import de.fhpotsdam.unfolding.utils.*;
import de.fhpotsdam.unfolding.providers.*;

UnfoldingMap map;

ArrayList<Position> Bcontainer = new ArrayList(); //declare and create array "Big container" 
int maxSize = 0;
int upTo = 0;
int time;

void setup()
{
  size(800, 600, P2D);
  smooth();

  // Create interactive map centered around Jeju
  map = new UnfoldingMap(this, new OpenStreetMap.OpenStreetMapProvider());
  map.zoomAndPanTo(10, new Location(33.35, 126.52));
  MapUtils.createDefaultEventDispatcher(this, map);
  map.setTweening(true);
 
  
  // Load CSV data
  Table DataCSV = loadTable("oneday.csv", "header");

  for (int i=0; i<24 ;i++)
  {
    
  for (TableRow Row : DataCSV.rows()) 
    {
      
    // Create new empty object to store data
    Position Scontainer = new Position();
   
    // Read data from CSV
    Scontainer.k = Row.getInt("T"+i);
    float lat = Row.getFloat("Y_COORD");
    float lng = Row.getFloat("X_COORD");
    Scontainer.location = new Location(lat, lng);
    
    // Add to list of all location
    Bcontainer.add(Scontainer);
    maxSize = max(maxSize, Scontainer.k);
    }
  }
    newTime();
} 

// OK we put all (FROM 1~31 DAY) POINTS INTO BCONTAINER

void draw() 
{
  // Draw map and darken it a bit
  map.draw();
  fill(0, 150);
  rect(0, 0, width, height);

  noStroke();
  for( int i = 0; i < upTo; i++)
{
  for (Position Scontainer : Bcontainer) 
    {
    // Convert geo locations to screen positions
    ScreenPosition pos = map.getScreenPosition(Scontainer.location);
    float s = map(Scontainer.k, 0, maxSize, 1, 50);
    //the brightness of the circle
    fill(200, 30, 200, 50);
    ellipse(pos.x, pos.y, s, s);
    }
}

  if( millis() > time )
    {  
    newTime();
    
     if( ???? )
      {
      upTo++;
      }
    }
  }
  
void newTime()
{
  time = millis() + 100;
}
public class Position {
  Location location;
  int k ;
} 

My questions are

I used processing 2.X since only in that case

  1. in setup() I red all columns and added them in Bcontainer(arrylist)
  2. I want to read and draw column by column from Bcontainer. But I do not know how to do this.
    Do I have to use ‘2-D array?’
  3. what is the code that enables me to read and display data one column by one column?(Column : each T, so that I can display them on the screen in sequence

plz help me ㅜㅜ

Why are you using Processing 2.x instead of Processing 3?

Since ‘unfolding map’ does not work with 3.x version

You might try contacting the author for a copy of the Unfolding Maps Processing 3 beta:

See also a download link from:

You are using a table? You can address columns by their name or index.

See reference for row and table etc. (Journey, so I can‘t look at the moment)

Is there a link for the beta to use unfolding maps for P3? I’ve contacted the author but haven’t gotten a response as of yet?

1 Like

The download link in the link that Jeremy provided works:

And it states that it is for P3.

Using Google at first a click on the link did nothing and then I did an “Open in a new window” and refreshed and it downloaded!

Also a right click on the link and “Save link as…” works.

:)

1 Like

i can’t get it to work.

Hello,

It works here with Processing 3.5.4 on W10 Pro:

Not all the examples have active links to data.

:)

i live in that area but i can’t install it
edit: i suddenly can istall it but i don’t know how to now use it in processing