Not easy, not by any stretch. You’re well into the realm of business
logic and application programming.
First of all, unless you have a list of all zip codes, and a way to
determine the distance between them (the Great Circle calculation) and
you have a good way to take the distance and turn it into cost, this
idea is pretty well not going anywhere.
http://pluto.walterdavisstudio.com/zip/
I made this in the late 90’s as an experiment. It does something
similar to what you’re talking about. It’s not complete, as I used a
then-current copy of the USPS Zip Code database to load it up, and
haven’t touched it since.
But even with a new set of data, there’s some flaws with this
approach. Zip codes are described in the database as a latitude/
longitude point roughly central within an often jagged shape (the
bounds of that code). Two addresses in adjacent zip codes could be
noted as being 1 mile apart, when they are actually across the street
from one another. Conversely, a point on one edge of a Zip code could
be N miles further away from a point on the opposite side of another
Zip code. It gets even worse in sparsely-populated areas, where Zip
codes are usually a lot physically larger in order to draw a ring
around a similar number of households. And then, just to add insult to
injury, you’re computing a point-to-point (as the crow flies) distance
with this method, and not taking into account the topography and
street map in any way.
What you really need is a way to hook into a decent mapping system
like Google Maps, and use their routing algorithms to plot a driving
distance between two points. I don’t know of any off the top of my
head, but believe me when I tell you this: once you start working with
the Google Maps API, you will need your propeller-beanie screwed on
tight, and your can of Jolt nearby.
Walter
On Jun 13, 2011, at 3:37 PM, Marcus Do Carmo wrote:
Hello! Any suggestion on an easy way to create and maintain an order
form for a courier service that a customer could see an estimate for
delivery from a city to another or a state to another? I thought of
the PHP Feedback form, but I have no idea how to put everything like
different zip codes and prices together.
Thanks, Marcus
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options