Installing Processing 3 in Linux

I encounter this wonderful simulation from the following link.
transitland-processing-animation (because I do not have the right to insert a link to this post yet, so please copy and paste the phrase to google to find the github link).
However, I have several questions while trying to get it running.

I’m using Linux Ubuntu. The following are the steps to install Processing.

    1: Download Processing 3.
    2: Download Unfolding Maps version 0.9.9 for Processing 3.
    3: Navigate to ~/Documents/Processing/libraries on your machine.
    4: Drag and drop the unzipped Unfolding Maps folder into ~/Documents/Processing/libraries.
    5: Open Processing, navigate to Sketch > Import Library > Add Libary. Search for "Video Export" and click Install.
    6: Quit and re-open Processing.

I’m not exactly sure about the step 3 and step 4. More explicitly, how to find the ~/Documents/Processing/libraries folder? I have Processing 3 installed in my home folder. So, I can find ~/Processing folder, and inside of this folder, I have

devel@hpz4:~/processing$ ls
core  install.sh  java  lib  modes  processing  processing-java  revisions.txt  tools  uninstall.sh
devel@hpz4:~/processing$ 

So, what shall I do then?

I finally choose to use the lib folder. I mean, I drag and drop the unzipped Unfolding Maps into
~/Processing/lib.

Eventually, when I tried the first example following the read me file, the output is as the following.

devel@hpz4:~/Desktop/python_begin_again/transitland/transitflow$ python2 transitflow.py --name=bart --operator=o-9q9-bart

INPUTS:
date:  2019-03-02
name:  bart
API key:  None
1 operators to be downloaded.

o-9q9-bart 1 / 1
http://transit.land/api/v1/routes?per_page=10000&operated_by=o-9q9-bart
12 routes found.

http://transit.land/api/v1/stops?per_page=10000&served_by=o-9q9-bart
50 stops found.

http://transit.land/api/v1/schedule_stop_pairs?date=2019-03-02&per_page=10000&sort_min_id=0&operator_onestop_id=o-9q9-bart
9301 schedule stop pairs found.

success!

1 operators successfully downloaded.
0 operators failed.
Concatenating individual operator outputs.
Calculating trip segment bearings.
Total rows:  9301
Counting number of vehicles in transit.
Time elapsed:  0:00:24.503688

and

devel@hpz4:~/Desktop/python_begin_again/transitland/transitflow$ python2 transitflow.py --name=chicago --bbox=-87.992249,41.605175,-87.302856,42.126747 --clip_to_bbox --exclude=o-9-amtrak,o-9-amtrakcharteredvehicle

INPUTS:
date:  2019-03-02
name:  chicago
API key:  None
exclude:  ['o-9-amtrakcharteredvehicle', 'o-9-amtrak']
bbox:  -87.992249 41.605175 -87.302856 42.126747

http://transit.land/api/v1/operators?per_page=10000&bbox=-87.992249%2C41.605175%2C-87.302856%2C42.126747
5 operators in bounding box.
3 operators to be downloaded.

o-dp3-pace 1 / 3
http://transit.land/api/v1/routes?per_page=10000&operated_by=o-dp3-pace
228 routes found.

http://transit.land/api/v1/stops?per_page=10000&served_by=o-dp3-pace
https://api.transit.land/api/v1/stops?offset=10000&per_page=10000&served_by=o-dp3-pace&sort_key=id&sort_order=asc
https://api.transit.land/api/v1/stops?offset=20000&per_page=10000&served_by=o-dp3-pace&sort_key=id&sort_order=asc
25556 stops found.

http://transit.land/api/v1/schedule_stop_pairs?date=2019-03-02&per_page=10000&sort_min_id=0&operator_onestop_id=o-dp3-pace
10000
https://api.transit.land/api/v1/schedule_stop_pairs?date=2019-03-02&operator_onestop_id=o-dp3-pace&per_page=10000&sort_key=id&sort_min_id=4707804518&sort_order=asc
20000
https://api.transit.land/api/v1/schedule_stop_pairs?date=2019-03-02&operator_onestop_id=o-dp3-pace&per_page=10000&sort_key=id&sort_min_id=4707819294&sort_order=asc
30000
https://api.transit.land/api/v1/schedule_stop_pairs?date=2019-03-02&operator_onestop_id=o-dp3-pace&per_page=10000&sort_key=id&sort_min_id=4707864774&sort_order=asc
40000
https://api.transit.land/api/v1/schedule_stop_pairs?date=2019-03-02&operator_onestop_id=o-dp3-pace&per_page=10000&sort_key=id&sort_min_id=4707904035&sort_order=asc
retry 1 / 5: HTTP Error 502: Bad Gateway
retry 2 / 5: HTTP Error 502: Bad Gateway
retry 3 / 5: HTTP Error 502: Bad Gateway
retry 4 / 5: HTTP Error 502: Bad Gateway
retry 5 / 5: HTTP Error 502: Bad Gateway
failed:
HTTP Error 502: Bad Gateway
o-dp3-chicagotransitauthority 2 / 3
http://transit.land/api/v1/routes?per_page=10000&operated_by=o-dp3-chicagotransitauthority
retry 1 / 5: HTTP Error 502: Bad Gateway
retry 2 / 5: HTTP Error 502: Bad Gateway
retry 3 / 5: HTTP Error 502: Bad Gateway
137 routes found.

http://transit.land/api/v1/stops?per_page=10000&served_by=o-dp3-chicagotransitauthority
https://api.transit.land/api/v1/stops?offset=10000&per_page=10000&served_by=o-dp3-chicagotransitauthority&sort_key=id&sort_order=asc
retry 1 / 5: HTTP Error 502: Bad Gateway
retry 2 / 5: HTTP Error 502: Bad Gateway
retry 3 / 5: HTTP Error 502: Bad Gateway
retry 4 / 5: HTTP Error 502: Bad Gateway
retry 5 / 5: HTTP Error 502: Bad Gateway
failed:
HTTP Error 502: Bad Gateway
o-dp3-metra 3 / 3
http://transit.land/api/v1/routes?per_page=10000&operated_by=o-dp3-metra
retry 1 / 5: HTTP Error 502: Bad Gateway
retry 2 / 5: HTTP Error 502: Bad Gateway
retry 3 / 5: HTTP Error 502: Bad Gateway
retry 4 / 5: HTTP Error 502: Bad Gateway
retry 5 / 5: HTTP Error 502: Bad Gateway
failed:
HTTP Error 502: Bad Gateway
0 operators successfully downloaded.
3 operators failed.
failed operators: ['o-dp3-pace', 'o-dp3-chicagotransitauthority', 'o-dp3-metra']
Concatenating individual operator outputs.
Traceback (most recent call last):
  File "transitflow.py", line 404, in <module>
    df = concatenate_csvs("sketches/{}/{}/data/indiv_operators".format(OUTPUT_NAME, DATE))
  File "transitflow.py", line 184, in concatenate_csvs
    concatenated_df   = pd.concat(df_from_each_file, ignore_index=True)
  File "/usr/lib/python2.7/dist-packages/pandas/core/reshape/concat.py", line 212, in concat
    copy=copy)
  File "/usr/lib/python2.7/dist-packages/pandas/core/reshape/concat.py", line 245, in __init__
    raise ValueError('No objects to concatenate')
ValueError: No objects to concatenate

I’m not really sure, but it looks like you’re getting an error from the Pandas library indicating the reference df_from_each_file isn’t what it’s supposed to be.

You mention that you installed Processing 3. What was your install process?

1 Like

@kylec, I’m using Linux Ubuntu.
So, what I did is that, I download the processing-3.5.3-linux64.tgz file, and move it to my home directory. Then, use tar xzf processing-3.5.3-linux64.tgz to extract it to my home directory, to get the processing-3.5.3 folder. Then,

~$: cd ~/processing-3.5.3
~$: ./processing
~$: mv processing-3.5.3 processing

The last command above simply rename the processing-3.5.3 into processing. So each time, I will go to the
~/processing directory and run the command ./processing to open the processing application.

Gotcha. Well I don’t really know.
As for how to find the ~/Documents/Processing/libraries folder. I’m not sure if it helps, but Unfolding Maps has this to say about locating the directory Processing Sketches location:

To find the Processing sketches location on your computer, open the Preferences window of the Processing application and look for the “Sketchbook location” item at the top.

It then mentions the ‘libraries’ folder needs to be manually created there if this is your first added library.

It also seems like you’re getting a fair amount of HTTP request errors. If those are what’s used to populate the Pandas dataframe perhaps this is the root of the ValueError? I don’t know enough about Processing or Unfolding Maps to really help much, sorry.

1 Like