Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Nearest Dealer by PostCode solution

2 views
Skip to first unread message

Richard Lister

unread,
Dec 5, 2001, 1:31:12 PM12/5/01
to
Hi,

I am building a website which I would like to include a "find nearest
dealer by postcode" function.

Many sites on the web have this functionality, but the only way I can
find to do it, is to spend over Ł1000 on software. This site probably
isn't going to justify that kind of expenditure.

Is there an eaiser way to do it?

I have a list of all my dealers and their post codes.

Thanks,

Richard

Stuart Millington

unread,
Dec 5, 2001, 9:06:41 PM12/5/01
to
On 5 Dec 2001 10:31:12 -0800, pb...@hotmail.com (Richard Lister)
wrote:

>I am building a website which I would like to include a "find nearest
>dealer by postcode" function.
>Many sites on the web have this functionality, but the only way I can

>find to do it, is to spend over £1000 on software. This site probably


>isn't going to justify that kind of expenditure.
>Is there an eaiser way to do it?
>I have a list of all my dealers and their post codes.

Take all of your dealer's post codes then map them to longitude and
latitude co-ordinates. Take the user's entered post code, map that to
longitude and latitude co-ordinates. Then write a routine to calculate
the difference between the two for each of your dealers co-ordinates.
HINT: whilst it is not that complicated, it is not simple either and
requires 3rd party data to map post codes to longitude/latitude
positions - unless you already own that data (unlikely) you will have
to buy it in one form or another.

You could always get an O/S map of each area you have a dealer and
look up their grid position, store that in your own database, then do
the calculations - the calculations from one grid position to another
are not that complicated[1]. The hard part is getting a grid position
for the *customer's* post code.

FWIW 1,000 GBP sounds cheap for, what amounts to, a GIS database.
Simple postcode-house number software (in a Blue box - if you know
what I mean!!) is going to cost you that much - per user per year.

[1] Any 'O' Level (or CSE) Mathematics student could do it. Obviously,
that rules out anyone with a GCSE of grade B or below.

--
------------------------------------------------------------------
- Stuart Millington -
- mailto:ph...@dsv1.co.uk http://www.z-add.co.uk/ -

Steve Griffiths

unread,
Dec 6, 2001, 4:57:01 AM12/6/01
to
On Thu, 06 Dec 2001 02:06:41 +0000, Stuart Millington
<ne...@dsv1.co.uk> wrote:

>On 5 Dec 2001 10:31:12 -0800, pb...@hotmail.com (Richard Lister)
>wrote:
>
>>I am building a website which I would like to include a "find nearest
>>dealer by postcode" function.
>>Many sites on the web have this functionality, but the only way I can

>>find to do it, is to spend over Ł1000 on software. This site probably


>>isn't going to justify that kind of expenditure.
>>Is there an eaiser way to do it?
>>I have a list of all my dealers and their post codes.
>
> Take all of your dealer's post codes then map them to longitude and
>latitude co-ordinates. Take the user's entered post code, map that to
>longitude and latitude co-ordinates. Then write a routine to calculate
>the difference between the two for each of your dealers co-ordinates.
>HINT: whilst it is not that complicated, it is not simple either and
>requires 3rd party data to map post codes to longitude/latitude
>positions - unless you already own that data (unlikely) you will have
>to buy it in one form or another.
>
> You could always get an O/S map of each area you have a dealer and
>look up their grid position, store that in your own database, then do
>the calculations - the calculations from one grid position to another
>are not that complicated[1]. The hard part is getting a grid position
>for the *customer's* post code.
>
> FWIW 1,000 GBP sounds cheap for, what amounts to, a GIS database.
>Simple postcode-house number software (in a Blue box - if you know
>what I mean!!) is going to cost you that much - per user per year.
>
>[1] Any 'O' Level (or CSE) Mathematics student could do it. Obviously,
>that rules out anyone with a GCSE of grade B or below.
>

This would work in theory and probably in practice in flat terrain,
but I think you might get some odd results if you were in a hilly
area.

For example the nearest dealer could be 5 miles away as the crow
flies, but this would involve going over a mountain and it would make
far more sense to go to a dealer 10 miles away down the valley.

An easy way of doing this (if rather long-winded to set up) would be
to obtain the full list of postal 'out codes' (the first part of the
code) then, using a postcode map, allocate each 'out code' to one of
the dealerships. That information could then be encoded as a simple
lookup table in a database. You could even have first and second
choices for a particular code.

It's a bit crude, but it's simple and doesn't require any postcode to
lat./long. mapping.


Angel

unread,
Dec 6, 2001, 5:10:42 AM12/6/01
to
On Thu, 06 Dec 2001 02:06:41 +0000, Stuart Millington
<ne...@dsv1.co.uk> wrote:

>On 5 Dec 2001 10:31:12 -0800, pb...@hotmail.com (Richard Lister)
>wrote:
>
>>I am building a website which I would like to include a "find nearest
>>dealer by postcode" function.
>>Many sites on the web have this functionality, but the only way I can

>>find to do it, is to spend over Ł1000 on software. This site probably


>>isn't going to justify that kind of expenditure.
>>Is there an eaiser way to do it?
>>I have a list of all my dealers and their post codes.
>
> Take all of your dealer's post codes then map them to longitude and
>latitude co-ordinates. Take the user's entered post code, map that to
>longitude and latitude co-ordinates. Then write a routine to calculate
>the difference between the two for each of your dealers co-ordinates.
>HINT: whilst it is not that complicated, it is not simple either and
>requires 3rd party data to map post codes to longitude/latitude
>positions - unless you already own that data (unlikely) you will have
>to buy it in one form or another.
>
> You could always get an O/S map of each area you have a dealer and
>look up their grid position, store that in your own database, then do
>the calculations - the calculations from one grid position to another
>are not that complicated[1]. The hard part is getting a grid position
>for the *customer's* post code.
>
> FWIW 1,000 GBP sounds cheap for, what amounts to, a GIS database.
>Simple postcode-house number software (in a Blue box - if you know
>what I mean!!) is going to cost you that much - per user per year.
>
>[1] Any 'O' Level (or CSE) Mathematics student could do it. Obviously,
>that rules out anyone with a GCSE of grade B or below.


www.streetmap.co.uk

OS and Lat-Long

Mogga

unread,
Dec 6, 2001, 5:34:15 AM12/6/01
to
On Thu, 06 Dec 2001 02:06:41 +0000, Stuart Millington
<ne...@dsv1.co.uk> wrote:


>[1] Any 'O' Level (or CSE) Mathematics student could do it. Obviously,
>that rules out anyone with a GCSE of grade B or below.
>

Couldn't they simulate GCSEs and ask their dad?
--
alt.www.affiliate
Newsgroup for Affiliate Discussions
http://www.htmlcook.com/cj_merchant_information.htm
bti please add free.uk.btinternet.chatter.refugees

Angel

unread,
Dec 6, 2001, 5:38:16 AM12/6/01
to
On Thu, 06 Dec 2001 02:06:41 +0000, Stuart Millington
<ne...@dsv1.co.uk> wrote:

>On 5 Dec 2001 10:31:12 -0800, pb...@hotmail.com (Richard Lister)
>wrote:
>
>>I am building a website which I would like to include a "find nearest
>>dealer by postcode" function.
>>Many sites on the web have this functionality, but the only way I can

>>find to do it, is to spend over Ł1000 on software. This site probably


>>isn't going to justify that kind of expenditure.
>>Is there an eaiser way to do it?
>>I have a list of all my dealers and their post codes.
>
> Take all of your dealer's post codes then map them to longitude and
>latitude co-ordinates. Take the user's entered post code, map that to
>longitude and latitude co-ordinates. Then write a routine to calculate
>the difference between the two for each of your dealers co-ordinates.
>HINT: whilst it is not that complicated, it is not simple either and
>requires 3rd party data to map post codes to longitude/latitude
>positions - unless you already own that data (unlikely) you will have
>to buy it in one form or another.
>
> You could always get an O/S map of each area you have a dealer and
>look up their grid position, store that in your own database, then do
>the calculations - the calculations from one grid position to another
>are not that complicated[1]. The hard part is getting a grid position
>for the *customer's* post code.
>
> FWIW 1,000 GBP sounds cheap for, what amounts to, a GIS database.
>Simple postcode-house number software (in a Blue box - if you know
>what I mean!!) is going to cost you that much - per user per year.
>
>[1] Any 'O' Level (or CSE) Mathematics student could do it. Obviously,
>that rules out anyone with a GCSE of grade B or below.

www.streetmap.co.uk

This gives you OS and Lat/Lon for any Postcode.

Graham L

unread,
Dec 6, 2001, 5:54:37 AM12/6/01
to
On 5 Dec 2001 10:31:12 -0800, pb...@hotmail.com (Richard Lister)
wrote:

>Hi,

Depending on the number of dealers, their location and the accuracy
you want, could you not set up a database of all post code starting
letters ie LS (Leeds) YO (York) etc. When the "customers" post code is
entered a script strips out everything but the first 2 letters, looks
in the database for that area code and lists all the dealers you
entered against that area code.


Regards,
Graham
http://www.westfield-design.co.uk

Clarke - UK Internet Sites Ltd

unread,
Dec 6, 2001, 7:01:14 AM12/6/01
to
"Steve Griffiths" <st...@egsystems.co.uk> wrote in message
news:3c0f3dd8...@news.freenet.co.uk...

> On Thu, 06 Dec 2001 02:06:41 +0000, Stuart Millington
> This would work in theory and probably in practice in flat terrain,
> but I think you might get some odd results if you were in a hilly
> area.
>
> For example the nearest dealer could be 5 miles away as the crow
> flies, but this would involve going over a mountain and it would make
> far more sense to go to a dealer 10 miles away down the valley.

Yeap you can only do it as the crow fly's but what I would do is show them
the nearest dealers plus anyone say within 10 miles of that, not that hard
to program, I know I done it all ready, then they can pick the one they want
to go to, all you do is explain it is as the crow fly's.. if the post office
and royal mail can't do it then I doubt you can.. but here is something I
never used.. once it display's what the nearest places are, link to
multimap.co.uk to show the route they can take, it's free and easy to do if
you have there postcode and your dealers postcode.

> An easy way of doing this (if rather long-winded to set up) would be
> to obtain the full list of postal 'out codes' (the first part of the
> code) then, using a postcode map, allocate each 'out code' to one of
> the dealerships. That information could then be encoded as a simple
> lookup table in a database. You could even have first and second
> choices for a particular code.
>
> It's a bit crude, but it's simple and doesn't require any postcode to
> lat./long. mapping.

Sadly it's very crude.. you would need to know what postal codes border each
other, for example the area I stay in has 5 postal out codes around it..
some starting with Gxx and others starting with PAx (x is a number) so you
would need to take that into account for everyplace in the UK, not much fun,
but if you had the time would be the cheapest way to go but not the best.

--
Best Wishes,

Clarke
UK Internet Sites Ltd
http://www.ukinternetsites.co.uk

Cut and Paste Scripts: http://www.cutandpastescripts.com
Website Free Stuff: http://www.websitefreestuff.com
British NIC: http://www.britishnic.com


Clarke - UK Internet Sites Ltd

unread,
Dec 6, 2001, 7:03:00 AM12/6/01
to
"Graham L" <gra...@westfield-design.co.uk> wrote in message
news:3c0f4b2b...@news.claranews.com...

>
> Depending on the number of dealers, their location and the accuracy
> you want, could you not set up a database of all post code starting
> letters ie LS (Leeds) YO (York) etc. When the "customers" post code is
> entered a script strips out everything but the first 2 letters, looks
> in the database for that area code and lists all the dealers you
> entered against that area code.

Sadly .. you would need to know what postal codes border each other, for

Clarke - UK Internet Sites Ltd

unread,
Dec 6, 2001, 7:16:57 AM12/6/01
to
"Richard Lister" <pb...@hotmail.com> wrote in message
news:4e0a7502.01120...@posting.google.com...

> Hi,
>
> I am building a website which I would like to include a "find nearest
> dealer by postcode" function.
>
> Many sites on the web have this functionality, but the only way I can
> find to do it, is to spend over Ł1000 on software. This site probably
> isn't going to justify that kind of expenditure.

Is that the software or the postcode database file that's going to cost you
that? If it's both you have a great deal here.. as the postcode database (in
the simple form you need) I found a company that could sell me this for
around Ł850 (a year licence, if you want to keep it up to date). As for the
program, I would have to make this myself if I wanted the project to come in
cheap.. I never did get the chance to complete it as the client only had 20
stores at the time and didn't see the point.

> Is there an eaiser way to do it?

Well if you can program it yourself, ask the postcode database companys, for
a sample area of codes and a costing for the full data, soem will be very
expensive, full list of who is selling this stuff is on the Royal Mail
website.

> I have a list of all my dealers and their post codes.

That's a start and here is another head start for you.. I worked it all out
like I said to make sure I could program it before I told the customer what
the cost would be.. in the end they said it would cost to much, like
anything custom, people want it but unless they are mega rich don't want to
pay the price.

Here is how you work it out, enjoy:

Postcode: GU3 2AX is East: 49370 North: 15150

Postcode: GU16 7PW is East: 48710 North: 15830

Difference East is: 660

Difference North is: -680

East is 660 and Squared is 435600

North is -680 and Squared is 462400

Add them both up and you get 898000

the Square root of 898000 is 947.628619238571

round that up or down to the nearest and it is 948

and the distance is after you divied by 100 is 9.48

so that's 9.48 Km and in miles this would be 5.890872

round that up or down to the nearest and it is 5.89 Miles

(round up or down will depend on the number you get, round down if it's
below 0.005 and up if over 0.005)

I never done very well at Maths in school, so I contacted my old school..
talk to my old maths teacher and asked him if this was right or not.. he
confirmed it was right and then asked who done it for you LOL :-)

Graham L

unread,
Dec 6, 2001, 7:39:59 AM12/6/01
to
On Thu, 6 Dec 2001 12:03:00 -0000, "Clarke - UK Internet Sites Ltd"
<cla...@NO-SPAMukinternetsites.com> wrote:

>"Graham L" <gra...@westfield-design.co.uk> wrote in message
>news:3c0f4b2b...@news.claranews.com...
>>
>> Depending on the number of dealers, their location and the accuracy
>> you want, could you not set up a database of all post code starting
>> letters ie LS (Leeds) YO (York) etc. When the "customers" post code is
>> entered a script strips out everything but the first 2 letters, looks
>> in the database for that area code and lists all the dealers you
>> entered against that area code.
>
>Sadly .. you would need to know what postal codes border each other, for
>example the area I stay in has 5 postal out codes around it.. some starting
>with Gxx and others starting with PAx (x is a number) so you would need to
>take that into account for everyplace in the UK, not much fun, but if you
>had the time would be the cheapest way to go but not the best.

Oppp's, didn't see that Steve had suggested the same idea earlier. I
did say it was dependant on the accuracy required.

Naturally for people living near the boundary of a post code "block"
the nearest dealer may well be near the boundary of a different one.

If the number of dealers is low and spread around the country then a
UK map may be better. Split the country into say 7 blocks (Scotland,
Wales, N England, Midlands......) then image map to 7 html pages that
contain the dealerships in that area.

Regards,
Graham
http://www.westfield-design.co.uk

Steve Griffiths

unread,
Dec 6, 2001, 10:33:21 AM12/6/01
to
On Thu, 6 Dec 2001 12:01:14 -0000, "Clarke - UK Internet Sites Ltd"
<cla...@NO-SPAMukinternetsites.com> wrote:

>"Steve Griffiths" <st...@egsystems.co.uk> wrote in message
>news:3c0f3dd8...@news.freenet.co.uk...
>> On Thu, 06 Dec 2001 02:06:41 +0000, Stuart Millington
>> This would work in theory and probably in practice in flat terrain,
>> but I think you might get some odd results if you were in a hilly
>> area.
>>
>> For example the nearest dealer could be 5 miles away as the crow
>> flies, but this would involve going over a mountain and it would make
>> far more sense to go to a dealer 10 miles away down the valley.
>
>Yeap you can only do it as the crow fly's but what I would do is show them
>the nearest dealers plus anyone say within 10 miles of that, not that hard
>to program, I know I done it all ready, then they can pick the one they want
>to go to, all you do is explain it is as the crow fly's.. if the post office
>and royal mail can't do it then I doubt you can.. but here is something I
>never used.. once it display's what the nearest places are, link to
>multimap.co.uk to show the route they can take, it's free and easy to do if
>you have there postcode and your dealers postcode.
>

It isn't me who's trying to solve the problem but the original poster.


I was suggesting a simple solution that might work for a small number
of dealerships without needing an expensive postcode to lat/long
lookup table, PAF or anything else.

>> An easy way of doing this (if rather long-winded to set up) would be
>> to obtain the full list of postal 'out codes' (the first part of the
>> code) then, using a postcode map, allocate each 'out code' to one of
>> the dealerships. That information could then be encoded as a simple
>> lookup table in a database. You could even have first and second
>> choices for a particular code.
>>
>> It's a bit crude, but it's simple and doesn't require any postcode to
>> lat./long. mapping.
>
>Sadly it's very crude.. you would need to know what postal codes border each
>other,

Nothing sad about it. It's a simple low cost solution that involved a
little bit of manual graft to set up that's all. Could also be a pain
to maintain if your dealers keep changing.

I'm well aware that there is no logic to postcode boundaries but
that's why you need the official postcode map.

>for example the area I stay in has 5 postal out codes around it..
>some starting with Gxx and others starting with PAx (x is a number) so you
>would need to take that into account for everyplace in the UK, not much fun,
>but if you had the time would be the cheapest way to go but not the best.
>

Unless you want incredibly fine granularity (i.e. a dense dealer
network), all you need is a simple lookup based on the post 'out
code'. You just get yourself a postcode map, stick a pin in where you
have a dealer then divvy up the adjacent postal areas between the
dealers. Once you've done this, you make a lookup table of the post
out codes covered by each dealer. When the customer enters the
postcode do a reverse lookup on the post out code to return the
dealer.

Another complication is (depending on the nature of the dealership)
they may have agreed territories and not want to attract work from
'out of area' - this is often a problem with franchisees for example.
In this case, you have to get the dealer to *tell you* which postal
areas they service, so maths doesn't help.

Nick Kew

unread,
Dec 6, 2001, 4:20:11 PM12/6/01
to
In article <4e0a7502.01120...@posting.google.com>, one of infinite monkeys

at the keyboard of pb...@hotmail.com (Richard Lister) wrote:
>
> Many sites on the web have this functionality, but the only way I can
> find to do it, is to spend over Ł1000 on software. This site probably
> isn't going to justify that kind of expenditure.

The software isn't the problem (e.g. the umn mapserver is Free, and I don't
*think* money can buy anything better for the job).

However, the _data_ is an entirely different proposition. The OS monopoly
keeps map prices up, and I'm not sure you'll even get a foot in the door
for Ł1000. Teaming up with an authorised third-party supplier might
help.

--
Nick Kew

Site Valet - the essential service for anyone with a website.
<URL:http://valet.webthing.com/>

Dr John Stockton

unread,
Dec 6, 2001, 4:50:30 PM12/6/01
to
JRS: In article <4e0a7502.01120...@posting.google.com>, seen
in news:uk.net.web.authoring, Richard Lister <pb...@hotmail.com> wrote
at Wed, 5 Dec 2001 10:31:12 :-

>
>I am building a website which I would like to include a "find nearest
>dealer by postcode" function.
>

If the dealers are exclusively licensed for non-overlapping service
areas (like MPs are), then you need to get the definitive list of who
serves where.

If the dealers can serve who they like and the customers can choose
their dealer, then you should not be forcing the nearest; in any case,
the nearest may be a more difficult journey.

Most people know their postcodes, and those of nearby areas; just
provide a list of dealers in full postcode order. If there are more
than, say, about 50 dealers, split them into overlapping geographical
areas listing a reasonable number for each - for example the coast of
Wessex might go from Cornwall to the New Forest, South from mid-Dorset
to Hastings, South-East from Arundel round to London. Ask the dealers
to choose which entries are reasonable for them.

If you have main or specialist dealers, you may want to list them in
areas further away.

By being automated and prescriptive, you are bound to annoy or
inconvenience both sides.

--
© John Stockton, Surrey, UK. j...@merlyn.demon.co.uk Turnpike v4.00 MSIE 4 ©
<URL: http://www.jibbering.com/faq/> FAQ for comp.lang.javascript by Jim Ley.
<URL: http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.

Me

unread,
Dec 7, 2001, 12:58:57 PM12/7/01
to
On 5 Dec 2001 10:31:12 -0800, pb...@hotmail.com (Richard Lister)
wrote:

>Hi,

I have just launched a site called hampshirepages.com which is an
online business directory. It doesn't do exactly what you want but by
definition of the post code system it must come close.

If you select a category and then just use part of the post code to
search then it will return the relevant results. I would have thought
that if you start with a search using the first half of the post code
ie PO1 and then try PO if that doesn't yield any results.

Mine just uses the "like" query to suck data from a MySQL table.

Andy


rochese...@gmail.com

unread,
Jul 24, 2019, 6:44:33 PM7/24/19
to

Email........rocheseller355@gmail.com

Call/ Text/ Whatsapp.....+237675848380

Wickr me.....rocheseller353


Hello
We are leading suppliers of pharmaceutical products,
backed with good deals for long term buyers and a good and reliable deal.
If what you are interested in is not on my list let me know what you need.
I also offer small paid sample packs to built trust

see prices:

FOR DIAZEPAM AND KETAMINE SMALLER ORDER

diazepam 10mg 300pills £90
diazepam 10mg 500pills £150
diazepam 5mg 1000pills £250
ketamine £20 each vial/1g

FOR DIAZEPAM AND KETAMINE BULK ORDER

diazepam 10mg 1000pills £250
diazepam 10mg 2000pills £500
diazepam 10mg 5000pills £1000
diazepam 5mg 1000pills £100
diazepam 5mg 5000pills £270
diazepam 5mg 10000pills £500
diazepam 10mg 10000pills £600
ketamine £15 each vial/1g

FOR KETAMINE SMALLER ORDER

5vials............£100
10vials............£175
20vials............£325
25vials............£400

FOR KETAMINE BULK ORDER

25vials............£400
50vials............£650
100vials............£1200
200vials............£1500

other products available for sale

xanax 0.5mg
zopiclone 7.5mg,
Tramadol 100mg, 200mg & 225mg
oxycodone 5mg & 10mg,

i also have my delivery records all around the world and i provide
dated pictures with buyers name and my name


Email........rocheseller355@gmail.com

Call/ Text/ Whatsapp us.....+237675848380

Wickr me.....rocheseller353

rochese...@gmail.com

unread,
Oct 16, 2019, 4:15:55 AM10/16/19
to
Email........rocheseller355@gmail.com

Call/ Text/ Whatsapp.....+1682077053

Wickr me.....rocheseller353


high Mates
We are back as leading suppliers of pharmaceutical products for anxiety, pain relief
backed with good deals for long term buyers and a good and reliable deal.
If what you are interested in is not on our menu let us know what you need. We also offer small paid sample packs to built trust for first time buyers

see the menu:

FOR ROCHE(DIAZEPAM, TEVA,VALIUM) AND KETAMINE SMALLER ORDER

diazepam 10mg 300pills £90
diazepam 10mg 500pills £150
diazepam 5mg 1000pills £250
ketamine each vial/1g £20

FOR DIAZEPAM AND KETAMINE BULK ORDER

diazepam 10mg 1000pills £250
diazepam 10mg 2000pills £500
diazepam 10mg 5000pills £1000
diazepam 5mg 1000pills £100
diazepam 5mg 5000pills £270
diazepam 5mg 10000pills £500
diazepam 10mg 10000pills £600
ketamine each vial/1g £15

FOR KETAMINE SMALLER ORDER

5vials............£100
10vials............£175
20vials............£325
25vials............£400

FOR KETAMINE BULK ORDER

25vials............£400
50vials............£650
100vials............£1200
200vials............£1500

other products available for sale

xanax 0.5mg
zopiclone 7.5mg,
Tramadol 100mg, 200mg & 225mg
oxycodone 5mg & 10mg,

We also have our delivery records all around the world and we provide
dated pictures with buyers names


Email........rocheseller355@gmail.com

Call/ Text/ Whatsapp.....+1682077053

Wickr me.....rocheseller353

0 new messages