-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distance based shelters #7
Conversation
Also, I'm not a js coder so I welcome any style clean up comments; get as pedantic as you want! |
@dstuck thanks for this work, and thanks for posting it as a draft for discussion. Very helpful. I'm not opposed to your change, since I think the experience could possibly be better. However, I'm not sure about this direction because I think the change from "return a max of 3 shelters within In addition, I'm concerned that the need to geocode the inputs would end up meaning reliance on an external service that may end up costing money. (That's in addition to the performance hit you've already noted, which I think we might be able to get around with a bit of creative JS coding.) To clarify what the current process does, it:
Note that if there are less than 3 within the radius, the user will get less, rather than getting 3 shelters even if they're miles away. Because of that, I think we need to maintain the mile radius in the mix. I'm happy to talk through how this process can be made better (and I'm sure it can be), but I'm not sure I'm ready to run with this approach yet. Is my understanding of what you're doing incorrect? I'd appreciate if you could walk me through your approach in a bit more detail. What is your goal with this approach, and could you walk through the algorithm/steps to get there? Thanks again. |
@nihonjinrxs Yeah the proposed new flow would be:
I think this flow separates responsibilities a little cleaner and enables us to improve our location extraction in the future to possibly use geocoding. I agree that we should investigate the cost of geocoding and discuss the value of specifying specific locations. I think it would really improve the usability but also it will make extracting location data and converting to latlon significantly more complicated |
Added back in support for multiple zip codes and for max radius which we can discuss changing later. If this looks reasonable, I'll finish up by adding test coverage on the refactored version and set as ready for review! |
Based on discussion at Project Night, we'll migrate this toward the following:
|
@dstuck I added you to the hurricane-response team. Let's push a new branch on this repo, and work together there. That'll mean closing this PR and creating a new one on that new branch. |
Refactoring the find shelters functionality to use distance from a given point. This is currently going to reduce efficiency but will enable using geocoding to get the closest shelters to any given point, not just the center of a zip code.
This code is definitely less performant as number of shelters goes up but we can add in some optimizations in the future so we're only checking a subset of zip codes first, but didn't include that in the initial version.
Currently posting as a draft because I know there are some changes to the overall functionality that haven't been discussed yet and so am gonna hold off on tests until I see people are happy with this proposed change in interface.