473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Is there a calculation in VBA code to work out distance between uk postcodes?

I have a database to work out delivery costs for our company. Everything is automated except the fuel costs. I am trying to work out if i could use code to work the distance bewteen each postcode which are turned into long and lat coordinates to give me a journey distance. From this is can then work out my fuel costs. I have searched the web with little success and alot of people are trying to do similar things. I see alot of people trying to use google maps api. Myabe this could be an option but not something i am familiar in. Any help or suggestions would be greatful.

Thanks,

Craig
Mar 29 '11 #1
2 3394
Stewart Ross
2,545 Expert Mod 2GB
It is possible to work out the distance, but not really on the basis of the postcode alone, as the distances you can calculate would be nominal straight-line distances between locations, not the distance of the road network between those locations.

In the UK postcode databases are commercial products licensed by Royal Mail. They sell a product called Postzon, which lists all UK postcodes and their associated eastings and northings, at a number of levels of accuracy - 100m, 10m and 1m. The 100m product is adequate for this application - approximating distances between postcodes - but this tells you little about the true length of the road network in between those locations.

Commercial GIS (Geographical Information Systems) usually model the road network, and like GPS-based sat-nav systems these can often provide information about the approximate length of the road network between any two junctions.

As commercial products are inevitably involved there is no single-step way to convert eastings and northings or longitude and latitude to road network distances using VBA or a similar approach. It may be possible to use Google's programming interface to Google maps to get the length of the road network, but I can't be sure of this without delving into the Google API.

Ordnance Survey is one of the major map providers in the UK, but their products are also commercial in nature and involve at least a one-off licence fee, with recurrent fees for updates.

-Stewart
Mar 29 '11 #2
Thanks Stewart,

Thought it was going to be complicated. Just working out distance bewteen postcodes would be bad enough using long and lat but really needs to be distance of roads used. Now trying out mappoint to see if i can at all link the two applications.

Thanks for advice

Craig
Mar 29 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: Moritz Beller | last post by:
Dear programmers, Have a look at this function to generate random numbers from 1 to count. It simply does not work. Well, actually it compiles silently, but then returns "1" (Compiler: gcc/++...
1
by: FayeC | last post by:
I got this snippet online and for the life of me I can't seem to make it write the cookie.... The Flash has the labels mentioned in the code and I used the name=movie and the swconnect=true as...
4
by: Anna Maria | last post by:
Hi at all, please take a look to this code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> </HEAD> <BODY> <SCRIPT LANGUAGE="javascript"...
8
by: mheden | last post by:
Hello all, I'm using an Access 97 front-end with a SQL Server 2000 back-end. One particular bit of code runs a stored procedure to obtain a rowcount from one of the back-end tables. This works...
3
by: Anil | last post by:
hi will the following code work. typedef struct { unsigned char date; unsigned char sortie_num; unsigned int start_address; unsigned short offset; } sortie_data;
7
by: Peter Steele | last post by:
I have code to add a domain user to a local group but I'm not sure if it will work with NT domains or whether it will only work with Active Directory based systems. Here's the code: public void...
9
by: bhavik.patel | last post by:
Hi I have a rather simple question: I have following class definitions: class Base { public: virtual void display ()
3
by: xmail123 | last post by:
Why does this code work? I am new to C# and have been studying this piece of code. It loops through an Adjacency Matrix table to populate a tree view. I have two questions about why this code...
2
by: Geoff Cox | last post by:
Hello, I have 2 lines of code which are different but both work. I refer to the 3rd line with the url in it. In the first case the // are not escaped, in the second they are. Either ...
7
by: jharrison | last post by:
I'm finding it hard to make this code work in Python 3.0. Been looking at it for some time now: # import module for random functions import random # List of words for the computer to pick...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.