Using Turf, I created an app that estimates how easy it is for residents to get around on foot in Washington, DC using a collection of open datasets. The computation is performed 100% client-side and will work just as well offline as online. Try dragging the marker below and compare the walkability of different parts of the city.
In this example, yellow dots represent amenities in the area. Their size is based on each amenity’s importance to the estimation. For comparison, you can also toggle pedestrian dots. These red dots represent real world pedestrian counts gathered by the District Department of Transportation and compiled by the Howard University Transportation Research Center.
The algorithm used to score a location is straightforward. It creates rings around a point using Turf’s buffer function, then counts each amenity within each ring. Each amenity type is given a different weight, and a decay factor is applied as an amenity moves farther away from the location. For example, a metro stop a block away might be worth 6 points, but at 5 blocks away it is only worth 3 points.
The model takes the following datasets into account when calculating a walkability estimate (in order of weight):
- Metro stations
- Grocery stores
- Pharmacies
- Bike share stations
- Bars
- Zipcars
- Libraries
- Schools
- Post offices
While estimating the convenience of a particular location is interesting, what if we wanted to analyze an entire region at once? Using turf.grid, we can create a grid of points and determine the score at each location.
This type of heavy load processing demonstrates how we can use the same code written for the browser in Node.js at massive scale. The results are processed once, then visualized in browser.
The combination of data analysis and maps lets you answer questions about a place without ever setting foot there. Complex data modeling has historically been the domain of high end server and desktop-based software, but what if these processing tools could be built and distributed more easily? Turf is open source and moving fast. If there’s a feature you would like us to add, open an issue or drop us a line.