A Radius Search?

J

jp2msft

Where would I go to learn how a radius search using a zip code?

I've got a customer that wants to allow clients to search for businesses
within 5, 10, 20, or 50 miles.

Are radius calculations performed using known formulas?

The math isn't a problem. I just don't know how to go about it.
 
J

Jeff Johnson

Where would I go to learn how a radius search using a zip code?

I've got a customer that wants to allow clients to search for businesses
within 5, 10, 20, or 50 miles.

Are radius calculations performed using known formulas?

The math isn't a problem. I just don't know how to go about it.

I believe the most common way to perform this search is to use the Great
Circle calculation.

Actually, I find your question a bit odd. You say "the math isn't the
problem," which suggests to me you know which formula to use, so I have to
wonder what your question really IS....

Are you trying to a get lat/long from a ZIP code? If so, there may be some
free databases out there that provide this info. If not, you'll have to get
some commercial package for this, and many of them probably come with
distance calculation anyways.
 
V

vanderghast

If memory serves, MapPoint can make that kind of 'maximum driving distance
of ... miles (km), from a point' (which can be a postal code), but you get
it through the UI, or by using VBA, and the result is graphical, over
MapPoint map. If the OP uses MapPoint (as application or its COM-control),
then that is a matter to use automation, if not, an additionnal question is
'and in what format do you want the answer' ? I haven't much experience
with the specifics involved, so I can't really be more useful in that
matter, though.


Vanderghast, Access MVP

Peter Duniho said:
Where would I go to learn how a radius search using a zip code?

I've got a customer that wants to allow clients to search for businesses
within 5, 10, 20, or 50 miles.

Are radius calculations performed using known formulas?

The math isn't a problem. I just don't know how to go about it.

I believe the most common way to perform this search is to use the Great
Circle calculation. [...]

Or, more precisely, "_a_ great circle calculation". Because the planet
isn't a mathematically perfect shape, there is no mathematical formula
that gives an _exact_ answer to the question of "distance between two
points on Earth". But there are a number of variations on estimating that
number, depending on the degree of precision one requires. Pick the one
that seems more appropriate for your purposes.

I agree with Jeff...the original question is unclear. If the math isn't
the problem, then what is? And how is it a C# question?

Pete
 
I

Ignacio Machin ( .NET/ C# MVP )

Where would I go to learn how a radius search using a zip code?

I've got a customer that wants to allow clients to search for businesses
within 5, 10, 20, or 50 miles.

Are radius calculations performed using known formulas?

The math isn't a problem. I just don't know how to go about it.

Hi,

Yuo should give more details about what is what you know and what you
do not know. From you question it's not clear if you want to look up
using ZIP codes or simply by using distance frmo a point. Also what
geo info you have of your clients?
 
J

jp2msft

Sorry this has taken so long. Our Group Policy blocks Outlook Express and the
proxy causes the website version to be even flakier than it already is. I did
see the messages as they were posted, though. I just can't seem to make the
Reply window work. It always times out.

Anyway, I have degrees in mathematics and physics, so the math isn't a
problem (does that make sense now?). I'm not afraid of the math, in other
words.

I do not have MapPoint.

What I need is to enable someone to enter their zip code and select their
radius, and I can pull up the list of available locations within their area.

So many websites out there do this now that it must be trivial to do, right?

vanderghast said:
If memory serves, MapPoint can make that kind of 'maximum driving distance
of ... miles (km), from a point' (which can be a postal code), but you get
it through the UI, or by using VBA, and the result is graphical, over
MapPoint map. If the OP uses MapPoint (as application or its COM-control),
then that is a matter to use automation, if not, an additionnal question is
'and in what format do you want the answer' ? I haven't much experience
with the specifics involved, so I can't really be more useful in that
matter, though.


Vanderghast, Access MVP

Peter Duniho said:
Where would I go to learn how a radius search using a zip code?

I've got a customer that wants to allow clients to search for businesses
within 5, 10, 20, or 50 miles.

Are radius calculations performed using known formulas?

The math isn't a problem. I just don't know how to go about it.

I believe the most common way to perform this search is to use the Great
Circle calculation. [...]

Or, more precisely, "_a_ great circle calculation". Because the planet
isn't a mathematically perfect shape, there is no mathematical formula
that gives an _exact_ answer to the question of "distance between two
points on Earth". But there are a number of variations on estimating that
number, depending on the degree of precision one requires. Pick the one
that seems more appropriate for your purposes.

I agree with Jeff...the original question is unclear. If the math isn't
the problem, then what is? And how is it a C# question?

Pete
 
T

Tim Roberts

jp2msft said:
...
I do not have MapPoint.

What I need is to enable someone to enter their zip code and select their
radius, and I can pull up the list of available locations within their area.

So many websites out there do this now that it must be trivial to do, right?

No. It's not a math issue. You need a database that gives you the
lat/long of the center of each zip code. This cannot be computed -- you
have to get a database from somewhere, like the postal service. Then, you
need a service that takes a street address, city, and state, and converts
THAT to a lat/long. Again, there are places you can subscribe to that
provide that service.

Once you have that info, then of course it's (nearly) trivial to determine
the distance between two lat/long pairs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top