Resources for Computing Travel Cost¶
The spatial access measures depend on travel times or distances between origins and destinations. If you only need distances between origins and destinations, the package will calculate Euclidean distances for your projected data. If you need travel times for a specific travel mode, you need to generate these so-called travel time (or travel cost) matrices from other sources.
Explore and Download Pre-Computed Travel Times¶
Since this is computationally expensive and non-trivial to implement at scale, we pre-computed driving times between tracts within 100 km (62 miles) of each other for the whole US.
Explore the map of driving times between a selected Census tract and all tracts within 100 km (62 miles) by clicking around or entering an address. You can also download these results for driving or transit.
In addition to driving times between tracts within 100 km, you can access matrices for walking, transit or driving times between blocks or tracts for the 20 largest cities in the US. Note that there are some null values – these are usually due to population-weighted centroids that could not be snapped to nearby road networks, missing GTFS feeds for transit, or feeds that do not span more than one Census tract, as in less urban areas.
This page hosts point-to-point distance matrices generated by the Center for Spatial Data Science. The matrices come as bzipped CSVs, structured using the format shown here. Cities are listed according to their containing county code. The origins for each distance matrix are the population-weighted centroids that lie within each county, and the destinations are any population-weighted centroids that lie within 100 km of the buffered county. For a full list of origin and destination locations + attached populations, see the CSDS Box folder.
Some of the matrices linked here are very large when unzipped (up to 100 GB). We have created an example bash script demonstrating how to extract a smaller portion of a larger matrix using bzcat and awk. The script and a short example can be found here.
These matrices were generated using OpenTripPlanner (OTP) and Docker. The necessary containers can be found here and here and are also available on DockerHub. All matrices were generated with the following settings using all land-based GTFS feeds available in a given county buffer, including e.g. buses, subways, and lightrail (no ferries are included).
|Setting||Tract / Block|
|Max Travel Time||Tract||Inf||Inf||Inf|
|Max Walking Dist.||Tract||5 km||5 km||N/A|
|Walking Speed||Tract||~3 mph||~3 mph||N/A|
|Departure Time||Tract||N/A||Noon, nearest Monday||N/A|
|Max Travel Time||Block||90 min.||90 min.||N/A|
|Max Walking Dist.||Block||5 km||5 km||N/A|
|Walking Speed||Block||~3 mph||~3 mph||N/A|
|Departure Time||Block||N/A||Noon, nearest Monday||N/A|
Created by: Dan Snow, MPP | Sept. 2019
Compute your Own Travel Times¶
If you need to compute customized cost matrices, there are several options. This table lists some of them:
|pgRouting||docker||Good for driving, open-source and free, PostgreSQL/postgis and OpenStreetMap (OSM)|
|OSRM||install / R / docker||Best for driving, OSM, open-source and free, customized travel parameters, C++|
|Open Trip Planner||docker routing / resources / DockerHub||Best for transit, open-source and free, customized travel parameters, Java|
|Valhalla||install||Multi-modal, OSM, open-source, for fee at scale, Python|
|Pandana||install||Good for driving and walking, OSM, open-source and free, part of UrbanSim, Python|
|Graphhopper||install||Multi-modal, OSM, open-source, for fee at scale, Python|
|Spatial Access Package||install / notebooks||Best for walking, OSM, scales well, open-source and free, includes spatial access metrics, Python|
|e.g. dogr, R5 and gtfs-router||dogr, R5, gtfs-router||Selected R packages|
|Google Maps||install||Accurate multi-modal, customized travel parameters, commercial, expensive at scale|