No project description provided
Project description
metroscore
Metroscore is a Python package for analyzing transit quality in a region.
Abstract
In recent years, rideshare alternatives have significantly impacted public transit ridership in large American cities by offering speed and convenience. To address this issue, transit agencies require a measure of transit mode preference to determine when and where riders choose public transit over car-based options. This paper introduces Metroscore, an arcpy-powered API that computes a multidimensional preference statistic for transit agencies to evaluate their services in comparison to car-based transit. Metroscore allows transit planners to input their own networks or build one for their city and analyze the effects of potential changes on the transit system under various spatiotemporal constraints. The methodology is illustrated through case studies on three major cities: Cincinnati, San Diego, and New York. With Metroscore, transit agencies can make informed decisions regarding the development of transit services, respond to the growing popularity of rideshare options, and provide strong evidence to support transit expansion proposals. Metroscore is available as an open-source, pip-installable package, with opportunities for feedback and collaboration on future developments. This paper not only introduces the innovative tool, but also highlights its potential in improving transit quality and fostering sustainable urban mobility.
Installation
Prerequisites
arcgis
arcpy
. This is installed with ArcGIS Pro and is required to generate transit service areas.
Install using pip
pip install metroscore
Install from source
git clone https://github.com/agupta01/metroscore.git
cd metroscore
pip install -e .
Getting Started
Datasets
- GTFS: public transit agencies frequently publish their transit schedules in the General Transit Feed Specification (GTFS) format. This is a standard format for describing transit schedules and routes.
metroscore
uses the GTFS format to generate transit service areas. - Streets: In order for the network to know where people can and cannot walk, you will need a polyline dataset of streets. This dataset should also have a field called
RestrictPedestrians
to indicate whether pedestrians are allowed to walk on that street. If this field is not present, you should think about how to generate this using the existing fields (one approach, for example, might be to look at street speed, if available).
Building a transit network dataset
Pro tip: Generate your network dataset on ArcGIS desktop, as this will allow you to visually inspect the quality of it.
metroscore
has a function to do this using arcpy, but it assumes a certain data structure and quality and may fail without warning.
Follow the instructions here to generate a transit network dataset. This will generate a network dataset that can be used to generate transit service areas.
Selecting points
In order to run, metroscore needs one or more candidate points to score. These points can be manually selected or generated using the functions in metroscore.point_selection
. For example, to make a grid of approximately 100 points inside San Diego,
# get san diego boundary
sd_boundary = gis.content.get("4a27b8717df945298546fdf3456b0a16")
sd_poly = sd_boundary.layers[0].query("NAME = 'SAN DIEGO'").sdf.iloc[0].SHAPE
points = make_grid_points(sd_poly, N=100)
len(points)
87
Generating service areas
Next, one must generate driving and transit service areas for each point. This is done using the metroscore.service_areas
module. For example, to generate a 30 minute driving service area for each point,
time = datetime.datetime(2019, 1, 1, 8, 0, 0)
duration = [30]
metro_sdf = get_metro_service_areas(nd_path, points, cutoffs=duration, time_of_day=time)
drive_sdf = get_drive_time_service_areas(points, cutoffs=duration, time_of_day=time)
Scoring points
Finally, we can use the metroscore.analysis
module to generate metroscores. This will generate a metroscore for every service area generated inn the previous step (that is, for every point, duration and time combination). To do this,
mts_df = sd_mts_loc = compute_metroscore(metro_sdf, drive_sdf)
The resultant dataframe will have a column called "Metroscore" and another column named "Name" with each row being of the form " : 0 - ". You may then groupby or average across the different dimensions to analyze the metroscore results. To get the overall metroscore, simply average the Metroscore column as follows:
mts_df.Metroscore.mean()
0.045
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file metroscore-0.2.0.tar.gz
.
File metadata
- Download URL: metroscore-0.2.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8d1bca7cdedf1bbc94b08d8cf7f84b3854c13034be10eef43177e5d51406e30 |
|
MD5 | e6037a33a3fb7ffed2dd8d320b570e51 |
|
BLAKE2b-256 | e4fb42e707e14af89bec0efa4c857d1c73aa23df1872b683a2d646ab3f5e98f4 |
File details
Details for the file metroscore-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: metroscore-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96fb7ae3e3e901a8be89959feaaf9dc629c1fcbbee9d0e7ebdad1f331b56fa41 |
|
MD5 | c3d38db5c98e5269b9dea6573f1861e5 |
|
BLAKE2b-256 | 016004559e9aa9306829520d9173e59142f3a6f9ae598e4d3afb7e9ae3cbb8eb |