focusconsulting / housing-insights

Bringing open data to affordable housing decision makers in Washington DC. A D3/Javascript based website to visualize data related to affordable housing in Washington DC. Data processing with Python.
http://housinginsights.org
MIT License
58 stars 110 forks source link

Add shortest distance to WMATA api routes result #204

Closed NealHumphrey closed 7 years ago

NealHumphrey commented 7 years ago

The alpha version of the api has a nearby_transit endpoint that returns:

As an enhanced version, also return the shortest walking distance to each route.

For the 'bus_routes' and 'rail_routes' json results, instead of returning a list of strings, return a list of objects:

"bus_routes": [
    {'route': "30S", dist_in_miles': "0.02"},
    {'route': "D51", dist_in_miles': "0.23"}
  ]

Easiest implementation of this might be:

This ends up replacing the two calls to unique_transit_routes at the end, since we're doing it as we go in the for loop.

NealHumphrey commented 7 years ago

Resolved with #211