forked from mordax7/flathunter
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Filter properties based on Google Maps distance #472
Comments
colinemonds
pushed a commit
to colinemonds/flathunter
that referenced
this issue
Sep 13, 2023
This PR involves some refactoring. The problem is that previously, filters ran before making any calls to external APIs. Therefore, just adding another filter for the distance doesn't actually work: the distance information is not yet available when we apply the filters. We can't just run the filters later, because then we would run the Google Maps API calls before we filtered out any properties, meaning that we would incur Google Maps API calls for all properties that we find in our search, including those that we later filter out anyway based on price, size, etc. - and we actually have to pay for those requests! My solution is to group the filters in two chains, and then run one chain before and one after external API calls have been made. This way, we can run the distance filter after the API calls are made, but keep everything else the same.
This would be a great feature to have - thanks so much for your efforts with the PR! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While currently it is possible to get information on the distance from a property to some location (such as one's place of work) via the Google Maps Distance Matrix API, and while that information gets included in the message or notification flathunter sends, it is not currently possible to filter properties based on that distance.
This would be quite useful for me, as it would enable me to find properties within biking distance of my office.
PR incoming.
The text was updated successfully, but these errors were encountered: