Package: travel-time
spatial_access: Compute travel times and spatial access metrics at scaleCompute travel times and spatial access measures at scale (millions of origin-destination pairs in minutes).
Travel times for three modes: walking, biking, driving.
Spatial access measures: provider-to-people ratio, avg. time to nearest provider, count/attribute sum of nearby providers, weighted access scores and floating catchment areas.Latest ReleaseBuild StatusDocumentationTested Operating SystemsUbuntu, macOSComponents of spatial_access :spatial_access has two submodules:p2p: Generate many to many matrices with travel times for sets of coordinates. Usewalk,bikeordrivenetwork types (importtransitfrom other sources), or get the distance in meters.Models: Contains a suite of models for calculating spatial accessibility to amenities.To use this service as a ReST API, see:https://github.com/GeoDaCenter/spatial_access_apiIf you are a Windows user, instructions for installing Ubuntu on a virtual machine are at the bottom of the Readme.InstallationA modern compiler likegccorclang.DependenciesMacOS:brew install spatialindexUbuntu:sudo apt-get install libspatialindex-devsudo apt-get install python-tkPackagepip3 install spatial_accessMore detailed instructions for installing in0_Reqs_Install.ipynbUsageSee the iPython notebooks indocs/for example usage, The first two notebooks contain installation instructions and run through a simple demo to make sure you have the setup successfully installed:0_Reqs_Install.ipynb: Installation requirements to run the notebook demos1_Simple_Test_Demo: Simple demo to test your setup installation worksThe remaining notebooks walk through how to run the travel time matrix and spatial access metrics, including main functions and parameters:2_Methods: Purpose and structure of the package + methodology for estimating travel time matrices and spatial access metrics3_Travel_Time_Matrix.ipynb: How to run the travel time matrices usingp2p.py4_Access_Metrics.ipynb: How to run the access metrics (origin-based) usingModels.py5_Coverage_Metrics.ipynb: How to run the coverage metrics (destination-based) usingModels.py6_TSFCA.ipynb: How to run a two-stage floating catchment area model (origin-based) usingModels.pyThedatafolder contains the input_data needed to estimate the metrics undersources(for origins) anddestinations(for destinations).In output_data, thematricesfolder stores the estimated symmetric and asymmetric matrices.Themodelsfolder contains the results of the models' analyses.Finally,figuresstores the results of maps and plots calculated during the process.You can also download all of the notebooks in one PDF filehere.Overwriting default configuration valuesp2p provides default configuration values for edge weights and node impedance (see spatial_access/configs.py).
You can overwrite these as follows:from spatial_access.p2p import TransitMatrix
from spatial_access.Configs import Configs
custom_config = Configs()
# set fields of custom_cofig
tm = TransitMatrix(..., configs=custom_config)
# continue with computationMaintainanceInstructions for building locally (only for developers):Additional requirements:cythonandjinja2To regenerate .pyx files, run:bash cythonize_extension.sh(TravisCI will do this automatically on deployment)To install locally, run:sudo python3 setup.py installfrom spatial_access root directoryUnit tests require thepytestpackage. From package root directory, runpython3 -m pytest tests/to run all unit tests.PyPi MaintenanceThe package lives at:https://pypi.org/project/spatial-access/When a branch is pulled into Master and builds/passes all unit tests,
Travis CI will automatically deploy the build to PyPi.To update PyPi access credentials, see .travis.yml and follow the instructions athttps://docs.travis-ci.com/user/deployment/pypi/to generate a new encrypted password.Installing Ubuntu 18 LTS with dependencies from scratch (recommended for Windows users)Follow the instructions at this link:https://linus.nci.nih.gov/bdge/installUbuntu.htmlto set up a virtual machinesudo apt-get updatesudo add-apt-repository universesudo apt-get -y install python3-pipContinue with Installation Instructions (above)Questions/Feedback?spatial@uchicago.eduAcknowledgmentsDeveloped by Logan Noel at the University of Chicago's Center for Spatial Data Science (CSDS) with support from the Public Health National Center for Innovations (PHNCI), the University of Chicago, and CSDS.