More "realistic" example for using the Processing Geopoint library that interactively shows BART ridership by station and by journey (pair of stations where the system is entered and exited) with an optional population layer.
Though the Processing Geopoint documentation offers examples of use, they are generally quite small. This project provides a more realistic example of using these tools in a more complex Processing sketch. Specifically, this mini-project explores ridership of the Bay Area Rapid Transit system (BART) in the San Francisco Bay Area.
After installing Processing, simply clone this repository with git clone [email protected]:SchmidtDSE/processing-geopoint.git. Don't have git installed? You can also download as a zip file from GitHub.
A pre-built dataset is included and can be run through the Processing IDE (PDE) or via the command line.
Running via the PDE is simple:
- Open the PDE.
- Go to File > Open.
- Open
bart_geotools.pdewithin your local copy of this repository. - Click run.
- Another window, with the visualization, will pop up.
If processing-java is installed, you can do all of this from the command line at:
processing-java --sketch=bart_geotools --run
Just have --sketch=bart_geotools point to the bart_geotools directory within your copy of the repo.
The dataset is pre-built but the data pipeline can be run by using pipeline/pipeline.sh. Note that this is expected to be run with the following dependencies already installed:
- Python 3: Need an install with Python 3 and pip available. See the Hitchiker's Guide for installation details.
- wget: This utility is typically pre-installed on Linux but can be added with
apt-get install wgetor equivalent. For Mac, consider the wget brew formula. For Windows, consider a third-party wget build. Note that use of community builds is at your own risk.
If you are on Linux with aptitude, build.sh will install all dependencies (including Processing), run the data pipeline, and execute the sketch non-interactively.
The visualization deals with station ridership, journey ridership, and population estimations. Note that this describes the method currently employed on the main branch but community members may choose to modify this behavior.
The average weekday BART ridership data are aggregated such that any passenger entering or exiting the BART system at that station is considered in its ridership. Note that this uses the 202304 release. This is then represented as the area of the circle used to represent a station in the visualization.
A journey is the pairing of two stations such that all passengers entering at one station and exiting at another are considered in that journey's ridership. Put another way, passengers entering at station A and existing at station B are considered to be in the journey A - B.
By default, this is not directional (see pipeline/prep_dataset.py:DIRECTED). So, passengers entering at station B and exiting at station A are also considered to be part of the ridership for journey A - B. In other words, journey A - B is the same as journey B - A.
This visualization uses average weekday BART ridership data from the 202304 release and represents ridership by strokeWeight (line width) for lines between the two stations involved in the journey.
This visualization uses WorldPop 2020 Unconstrained USA Population Counts aggregated to a 5 letter geohash by summing all pixels found within a geohash's bounds. These are then visualized using a sequential mono-chromatic color scale.
Processing code should use two space tabs and follow standard Java conventions where possible including JavaDoc on any public or global scope methods and classes. All Python code should follow the Google Python Style Guide where possible. At this stage, unit test targets are not enforced. Code should pass automated tests before merge.
Pull requests and bug reports welcome. We do not have a formalized template but please be kind. Open source is often a labor of love done outside work hours / pay. We may decline to fulfill a bug or merge a PR in which case we politely recommend a fork.
Released under the BSD license. See LICENSE.md for more details. Copyright Regents of University of California.
Visualization uses:
- ColorBrewer 2.0 under the Apache 2.0 License.
- Silkscreen under the Open Font License.
- Processing under the LGPL
- processing-geopoint under the BSD License.
Data credits:
- BART geospatial KMLs under the BART DLA.
- BART ridership data under the CC-BY-4.0 License.
- Natural Earth under the public domain.
- WorldPop 2020 Unconstrained USA Population Counts under the CC-BY-4.0-International License
The data pipeline uses the following:
- geolib under the MIT License.
- geotiff under the LGPL.
- imagecodecs under the BSD License.
- kml2geojson under the MIT License.
- numpy under the NumPy License.
- xlsx2csv under the MIT License.
Some bash scripts also use the following but are not linked and are, instead, simply called:
- X Window System and Xvfb under the MIT License.
- OpenJDK under the GPL.
Sam Pottinger is the primary contact.
