Skip to main content

spatial_access: Compute travel times and spatial access metrics at scale

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 latest release
Build Status travis build status
Documentation read the docs
Tested Operating Systems Ubuntu, macOS

Components of spatial_access :

spatial_access has two submodules:

  • p2p: Generate many to many matrices with travel times for sets of coordinates. Use walk ,bike or drive network types (import transit from 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_api

If you are a Windows user, instructions for installing Ubuntu on a virtual machine are at the bottom of the Readme.

Installation

  1. A modern compiler like gcc or clang.

  2. Dependencies

    • MacOS:

      brew install spatialindex

    • Ubuntu:

      sudo apt-get install libspatialindex-dev

      sudo apt-get install python-tk

  3. Package

    pip3 install spatial_access

Usage

See the iPython notebooks in docs/ for example usage, or https://readthedocs.org/projects/spatial-acccess/ for technical documentation.

Overwriting default configuration values

p2p provides default configuration values for edge weights and node impedence (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 

Maintainance

Instructions for building locally (only for developers):

  • Additional requirements: cython and jinja2
  • To regenerate .pyx files, run: bash cythonize_extension.sh (TravisCI will do this automatically on deployment)
  • To install locally, run: sudo python3 setup.py install from spatial_access root directory
  • Unit tests require the pytest package. From package root directory, run python3 -m pytest tests/ to run all unit tests.

PyPi Maintenance

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.

  1. Follow the instructions at this link: https://linus.nci.nih.gov/bdge/installUbuntu.html to set up a virtual machine
  2. sudo apt-get update
  3. sudo add-apt-repository universe
  4. sudo apt-get -y install python3-pip
  5. Continue with Installation Instructions (above)

Questions/Feedback?

lnoel@uchicago.edu or spatial@uchicago.edu

Acknowledgments

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.

Metadata

Release files for spatial-access 0.1.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spatial-access 0.1.18
File Size Uploaded Provenance Actions
spatial_access-0.1.18.tar.gz 124.7 kB Without provenance Details for spatial_access-0.1.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spatial-access 0.1.18
File Interpreter ABI Platform Actions
spatial_access-0.1.18-py3.6-linux-x86_64.egg Legacy Egg format - - Details for spatial_access-0.1.18-py3.6-linux-x86_64.egg

Total release size: 436.1 kB

Release files / spatial_access-0.1.18.tar.gz

Download URL spatial_access-0.1.18.tar.gz
Size 124.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d2b4a4a28983c128de28537bcd038f6f48305d404fb33abb7a43b59a0febb466
BLAKE2b-256 checksum
How to use checksums
3fb42005d9b5d2bf7dcf0a8ced7f535509b343b148d134556f21f0f4703b94c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Release files / spatial_access-0.1.18-py3.6-linux-x86_64.egg

Download URL spatial_access-0.1.18-py3.6-linux-x86_64.egg
Size 311.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
e56af5d440d8882db4de1aca907136a9ed4d6b477f5157f2097fa8d094e4a6df
BLAKE2b-256 checksum
How to use checksums
0facbc961dd0d4c29264d55a222e4a39a78e9e167dce9945b41b72e1e3ca754a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Security for spatial-access 0.1.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.18 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page