zorostang / chicago_bike_equity

Visualization and analysis of Chicago bike lanes. An effort to determine how the bike lane installations are divided among the entire city.
MIT License
20 stars 14 forks source link

Count the number of Divvy stations near a given point #17

Open stevevance opened 9 years ago

stevevance commented 9 years ago

Install the context-menu plugin for Leaflet to allow the user to right-click a point on the map. Then find the 5 nearest Divvy stations and report their distances.

stevevance commented 9 years ago

The Turf.js "nearest" function only finds 1 feature and isn't extensible to find more than one. You can see this live on the map now, and it's also explained in my blog post.

@zorostang You should pull the latest from master because @rguico expanded your work on the Divvy station buffers to merge them into one polygon. I then added a right-click function that finds the nearest Divvy station to any part on the map.

rguico commented 9 years ago

This issue remains open so that we can consider implementing https://github.com/mapbox/leaflet-knn instead.

stevevance commented 9 years ago

@rguico Are you working on this?

rguico commented 9 years ago

Yes, but heads up: it might be a slower algorithm. If it's decidedly slower I'll let you know.

stevevance commented 9 years ago

@rguico Keep in mind there's just a small chance I might want to add bike directions between the point and the Divvy station. The reason I would keep it out is because this isn't a Divvy app. We need to determine the utility of such a function towards our mission before including it.

stevevance commented 9 years ago

@rguico Can you update this function to only show those Divvy stations within 1/4 mile? And can you count up to 20 stations to find those within 1/4 mile?

rguico commented 9 years ago

I'm on it. I won't be available Tuesday nights for the next 2 weeks because my parents / Tuesday babysitters are out of town. But I will try to find time for it.

On Tue, May 12, 2015 at 1:17 PM, Steven Vance notifications@github.com wrote:

@rguico https://github.com/rguico Can you update this function to only show those Divvy stations within 1/4 mile? And can you count up to 20 stations to find those within 1/4 mile?

— Reply to this email directly or view it on GitHub https://github.com/zorostang/chicago_bike_equity/issues/17#issuecomment-101372861 .

stevevance commented 9 years ago

@rguico Okay, I'll keep that in mind. I'm spending today closing out old issues and if you sync you'll see I integrated the "find nearest bike lane" to the right-click "Get Access Index".

stevevance commented 9 years ago

@rguico Can you also make these changes:

icon_divvy