Compute 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 Release | |
Build Status | |
Documentation | |
Tested Operating Systems | Ubuntu, macOS |
spatial_access has two submodules:
walk
,bike
or drive
network types (import transit
from other sources), or get the distance in meters.To use this service as a ReST API, see: https://github.com/GeoDaCenter/spatial_access_api
If you are a Windows user, instructions for installing Ubuntu on a virtual machine are at the bottom of the Readme.
A modern compiler like gcc
or clang
.
Dependencies
MacOS:
brew install spatialindex
Ubuntu:
sudo apt-get install libspatialindex-dev
sudo apt-get install python-tk
Package
pip3 install spatial_access
More detailed instructions for installing in 0_Reqs_Install.ipynb
See the iPython notebooks in docs/
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:
The remaining notebooks walk through how to run the travel time matrix and spatial access metrics, including main functions and parameters:
The data folder contains the input_data needed to estimate the metrics under sources (for origins) and destinations (for destinations).
In output_data, the matrices folder stores the estimated symmetric and asymmetric matrices.
The models folder contains the results of the models' analyses.
Finally, figures stores the results of maps and plots calculated during the process.
You can also download all of the notebooks in one PDF file here.
p2p 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 computation
cython
and jinja2
bash cythonize_extension.sh
(TravisCI will do this automatically on deployment)sudo python3 setup.py install
from spatial_access root directorypytest
package. From package root directory, run python3 -m pytest tests/
to run all unit tests.The 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 at https://docs.travis-ci.com/user/deployment/pypi/ to generate a new encrypted password.
sudo apt-get update
sudo add-apt-repository universe
sudo apt-get -y install python3-pip
spatial@uchicago.edu
Developed 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.