Open stevevance opened 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.
This issue remains open so that we can consider implementing https://github.com/mapbox/leaflet-knn instead.
@rguico Are you working on this?
Yes, but heads up: it might be a slower algorithm. If it's decidedly slower I'll let you know.
@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.
@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?
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 .
@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".
@rguico Can you also make these changes:
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.