Click to See Complete Forum and Search --> : serverside app help


tony sidney
02-11-2003, 04:28 PM
Hello
Quite new to websesign and i want to know how to make a quoting system for my courier firm website that i am making myself.

I have seen a system that works in a pop up window , you put in your start point and put in your finish point press a button and it calculates how far and how much it would cost. so if my start point was chelmsford essex england and my finish point was leeds yorkshire it would calculate 214 miles and then multiply that by my milage rate and come up with a quote.Is it possible to have it work from postcodes?

now i havnt gotr a clue where to start on this so any ideas anyone??

Brendan Nolan
02-11-2003, 11:08 PM
There are two ways I can see this working...

1.
You keep a database (or file) of locations along with longitude and latitude coordinates. Your script could use them to calculate direct distances between locations. You could do this with pretty much any scripting language.

2.
This gets messy, but offers you a solution which would give "by road" distances. You will need a database with a table that looks something like this...

| towns | town1 | town2 | town3 |
------------------------------------------
| town1 | 0 | 3 | 9 |
------------------------------------------
| town2 | 3 | 0 | 4 |
------------------------------------------
| town3 | 9 | 4 | 0 |
------------------------------------------

This way you will have to manually enter the distance between each town. And the table is slightly silly because everytime you add a new town the system will not only have to add a new row to the table, but a new column!





The EASIEST way would be for customers to simply enter an "estimated" distance, but obviously this would not be practical.

There are a few "Map Servers" about which do some fancy things, which include calculating distances BY ROAD from place to place... one I found was http://www.nowwhereroute.com/Scripts/hsrun.exe/Mapmaker/Mapmaker/MapXtreme.htx;start=HS_SearchPage?UserType=Guest

If you need something "smarter" then what I have mentioned above then you might want to talk to teh people who put the Map Server I just mentioned together...

Hope that all helped.

Ribeyed
02-12-2003, 07:54 AM
hi,
just a quick query regarding this.
Most corrier services charge by weight and not by distance surely you are going to do the same? Why should a customer who lives 3 miles further away than another customer, pay more for the same sized parcel to be delivered?
Royal Mail Packet post, Parcel Force and City Link all price by weight and not distance.
Hope this helps

tony sidney
02-12-2003, 04:44 PM
Thanks very much for your help on this subject that has given me a few pointers,
I am not strictly a courier its more of a chaufeur driven pallet service , dedicated deliveries if you want to take your chances with royal mail ,dhl, ups etc on your half a million pound print job or £250,000 computer system. sitting there praying that it all gets there in one piece and at the same time then go ahead , we like to think we give more than that and we dont cut people up on the road either. so its a pound a mile !

thanks again

tony

Ribeyed
02-12-2003, 06:37 PM
hi,
do you have your database with all the UK postcodes?

tony sidney
02-13-2003, 03:08 PM
hello

I havnt actually started it yet i am fishing for ideas of you guys post codes just seems the logical way . there must be one already made some where as i have seen these things on various courier sites. I just thought this would be the place to look first thought there might be a freebie laying around somewhere! but if i have to wade my way tthrough a ton of books to make this thing work then so be it