Code to replicate the analysis in: Millard-Ball, Adam. 2021. "The width and value of residential streets." Journal of the American Planning Association, in press.
For more information visit https://streetwidths.its.ucla.edu
This guide provides, hopefully, the easiest way to set up your environment to run this project. It assumes you have the following installed and are familiar with using them:
Setting up the conda environment:
conda env create -f environment.yml
).conda activate streetwidths
), and add
pgMapMatch to the environment's PATH (conda develop /path/to/the/directory/containing/pgMapMatch
, not pgMapMatch itself).Setting up the PostgreSQL database:
CREATE EXTENSION postgis; CREATE EXTENSION postgis_raster;
.host streetwidths all ::1/128 trust
SHOW data_directory;
.)Setting up the data and osm2po:
projections
at the start of calculate_street_value.py
. (If anyone wants to share a lookup file, please do and we can automate this step.)Note that the parcels data should have voids for the street rights of way, rather than representing streets with their own parcel(s). If you don't have avoids, you will probably get an out of memory error. (Feel free to adapt the code to make it robust to this situation.)
Additional Windows setup:
Calling calculate_street_value.py:
conda activate streetwidths
), and simply run
calculate_street_value.py using python (navigate to this project's root folder
and call python calculate_street_value.py
).postgres_user
variable near the top of calculate_street_value.py accordingly, and make sure
the user has the same privileges as postgres.if __name__ == '__main__':
and replace it with a call to run_counties()
, passing in a list
of county names matching those in Parcel_data (i.e.
run_counties(['san_francisco_ca','tarrant_tx'])
).runAll()
. However, you will need the parcel shapefiles for all 20 counties, and the underlying census data too. Feel free to contact the author for assistance. They will be in the main
schema as a postgres table: osm_metrics_XXXXX
, where XXXXX is the county fips code. You can also see some of the intermediate tables for the county.
See the data dictionary for details of how to interpret each column.
This study was made possible through funding received by the University of California Institute of Transportation Studies Statewide Transportation Research Program, funded by the Road Repair and Accountability Act of 2017 (SB 1). The authors would like to thank the State of California for its support of university-based research, and especially for the funding provided in support of this project.
Thanks to Theodore Lau for programming assistance and documentation.