Jump to content
Sign in to follow this  
Khonwan

Travel distance calculator

Recommended Posts

Hi Forum

I've asked a local company to design a web site for my new food delivery business and wanted to limit free home delivery to within a 5-miles drive between my postcode and the customer's. I'm sure I've seen another food company in the past using a tool whereby the customer inputs their postcode and the embedded app confirms the driving distance qualifies, i.e. that it is within 5 miles in my case. I would expect the food order to proceed for home delivery if the 5-mile test was met (driving distance...not radius), and  a message flagged should the distance be greater than 5 miles confirming this and asking if the customer wished to proceed with self collection from my business. My web designer is at a loss how to do this. Can anyone point me to such a tool or provide an idea on how to achieve this? I have no skills in coding or web design but I wish to pass on any of your ideas on this to my web designer. 

Thank you.

Share this post


Link to post
Share on other sites

There are plenty of ways to do this but a lot depends on the platform you plan to use for your website.

A quick google search revealed this solution: http://www.postcode-distance.com/postcode-radius-script

Or this one: https://www.freemaptools.com/distance-between-uk-postcodes.htm

A bit confused as to why your web designer can't do a Google search themselves.

If you can't find a script to do the job you could pay someone to write one for you. It's not that complicated to do so you could probably find a developer to do the job for around £300.

Share this post


Link to post
Share on other sites

Thanks, fisicx. The radius script wouldn't be as useful to me as it would include locations within 5 miles as the crow flies but well over that to drive to (out in the countryside). I had already found http://www.postcode.org.uk/, which looks very promising to me, but my web designer still thought it couldn't deliver my requirements. 

I've now sent him an example page from Deliveroo that first asks for the delivery postcode then allows or prevents (with a suitable message) completion of the order form, which is basically what I want, with the additional option of proceeding with an order on a booked collection basis where the postcode doesn't qualify for delivery. 

Share this post


Link to post
Share on other sites

deliveroo paid a huge wodge for their website. If you want the same then expect to pay a lot more the the amount I suggested.

Last time I built a distance calculator I just used the Google API. Google has changed its T&C so it might not be possible anymore but there is almost always a solution to a problem.

Have you employed a designer or a developer? If it’s the former I suspect they will struggle to do the work. Which is why I suggested paying someone to build this for you.

Edited by fisicx

Share this post


Link to post
Share on other sites

£300 to write that? A good developer will be charging AT LEAST £500 per day for building something like this.  Even if an API is provided you'd still need to write tests and so forth - I doubt it would take less than a day to do all the work involved if done to a professional standard.
That said it doesn't seem that you'd need to write this from scratch as an NPM package for this sort of work already exists https://www.npmjs.com/package/geolib

Share this post


Link to post
Share on other sites
10 hours ago, fisicx said:

A bit confused as to why your web designer can't do a Google search themselves.

It's not within a designers remit to locate scripts - how would they be able to judge that they meet the criteria such as the language used, how well is it written? how well is it tested etc.
What a designer should do is collaborate with a developer on these things.  If they make decisions on these things and throw finished designs over the fence things tend to end badly "This won't work in the browser" etc.

Share this post


Link to post
Share on other sites

I would probably approach this with a couple API's to try and get the data as accurate as possible. The first would be a postcode lookup service like https://postcodes.io, which sends an address to Google Distance Matrix API. It should be straight forward to do this by passing data from one API to another, but you definitely need to account for errors and timeouts if one API fails to respond. I would say this is more than a days work to do properly, and that's before you've added it to the forms on your site.

Deliveroo have a big web team now in London, it's generally not a good idea to take features from big sites and try and incorporate them without knowing how it's built. They most likely spent a large amount of time getting this feature and accuracy of the data correct, as they rely on the accuracy to get deliveries out on time.

Share this post


Link to post
Share on other sites
2 hours ago, rbrtsmith said:

£300 to write that? A good developer will be charging AT LEAST £500 per day for building something like this.  Even if an API is provided you'd still need to write tests and so forth - I doubt it would take less than a day to do all the work involved if done to a professional standard.

I charge less than that per day and consider my work to be of professional standard.

As you alluded, there are already scripts that do what is required and I’ve checked and the google API can provide the distance. So it’s not a complicated job.

Not everyone needs to charge £500/day.

Share this post


Link to post
Share on other sites
9 hours ago, fisicx said:

Not everyone needs to charge £500/day.

I guess it depends on your overheads and level of experience.  I know people who charge far in excess of this but their standard is incredibly high, and they solve complex problems with well architected code that has all the relevant automated tests.
I think you should charge what you believe you are worth relative to the market.  It's important to value skillset - the time and effort taken to acquire it and your time doing the actual work + sourcing it etc.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Member Statistics

    • Total Members
      58,259
    • Most Online
      4,970

    Newest Member
    BarbaraBlanc
    Joined
  • Forum Statistics

    • Total Topics
      65,768
    • Total Posts
      453,362
×