Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Filter Results by Distance from user location #106

Open
martinbagshaw opened this issue Feb 20, 2019 · 1 comment
Open

Filter Results by Distance from user location #106

martinbagshaw opened this issue Feb 20, 2019 · 1 comment
Labels

Comments

@martinbagshaw
Copy link
Contributor

Though we have limited results to UK only addresses, it would be good to be able to filter / order results by distance from the user's location in the form.

When entering my postcode (CM27JP) into the form, with age of 45, I receive 31 results, postcodes for the first few are as follows:

  1. CF14 2TL - Cardiff
  2. CB1 8RN - Cambridge
  3. CB2 0QQ - Cambridge
  4. CB2 0QQ - Cambridge
  5. CB2 0QQ - Cambridge
  6. CB2 0QQ - Cambridge
  7. CB2 0QQ - Cambridge
  8. SW17 0RE - Wandsworth
  9. CB2 0QQ - Cambridge
  10. SM2 5PT - Sutton

Do we want to show closest results immediately after the search / as default, or provide the user a filter to organise them after the initial search?

@martinbagshaw
Copy link
Contributor Author

In a branch I am working on, I am...

  • Using Bing API to convert postcodes into coordinates. Using a personal API key to make this work
  • Using Haversine Formula as suggested here to calculate the distance as the crow flies between two points.
  • Taking the above approach, as other more accurate / useful solutions that take into account actual driving distance are paid services, for example Google Distance Matrix, and the Bing equivalent. Open to other suggestions, needless to say.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant