DemocracyClub / UK-Polling-Stations

:earth_africa: A website to help people find their UK polling station
https://wheredoivote.co.uk/
BSD 3-Clause "New" or "Revised" License
33 stars 30 forks source link

Not necessarily clear on whether headline distance is walking or driving #4731

Open alexdutton opened 2 years ago

alexdutton commented 2 years ago

In feedback 118519 the user says:

The voting place is too far for me to walk, its two miles each way

The headline distance on the WDIV address view is:

It's about 1.9 miles away or a 6 minute drive from [post code]

However, that's the driving distance, and the walking distance is closer to 1.3 miles along footpaths, and the user hasn't necessarily realised this.

It's possible we should be clearer about both walking/driving options as opposed to using the 1.5km straight line distance to pick between without the user's input.

chris48s commented 2 years ago

There's a couple of things that have changed since we made that assumption:

  1. You can now do as many hits on the google directions API with one key as you like
  2. Its way easier to do async stuff in python these days

One thing you could do would be if the straight line distance is between X and Y, kick off requests for both ?mode=walking and ?mode=driving in parallel (to reduce the IO wait time), get them both back and then make the decision of which to show (by default) based on the responses rather than the straight line distance. The downside would be increased google API costs.