Radius Search

  • Thread starter Thread starter momo
  • Start date Start date
M

momo

Can anyone help me? I am writing an ASP.NET app. and I need to be able to
have people search based on X radius of a zip code. Please help.

Thanks,

Momo
 
Crap! I did this a few years ago but don't have the code anymore ... But
here's the idea, you're gonna have to hunt down and find the stuff though.

I got a hold of a database of every US zip code geocoded. So every zip code
had a Lat and a Long.

There's a simple formula to measure the distance (as the crow flies) between
two co-ordinates on the earth. The original formula is complex because it
takes into account the curvature of the earth, but in it's simplified form,
it gives good results with a very acceptable (small) margin of error.

Let's use the example of car dealerships, you have a table of them, with a
zip code for each.

Since you have your search zip code, you can lookup its Lat and Long, and
perform a search of all "car dealerships" within x miles of your search zip
code.

Having the formula and the zip code geocode table makes this a piece of
cake. sorry I can't find them :(
 
http://www.dbforums.com/archives/t284762.html

George Durzi said:
Crap! I did this a few years ago but don't have the code anymore ... But
here's the idea, you're gonna have to hunt down and find the stuff though.

I got a hold of a database of every US zip code geocoded. So every zip code
had a Lat and a Long.

There's a simple formula to measure the distance (as the crow flies) between
two co-ordinates on the earth. The original formula is complex because it
takes into account the curvature of the earth, but in it's simplified form,
it gives good results with a very acceptable (small) margin of error.

Let's use the example of car dealerships, you have a table of them, with a
zip code for each.

Since you have your search zip code, you can lookup its Lat and Long, and
perform a search of all "car dealerships" within x miles of your search zip
code.

Having the formula and the zip code geocode table makes this a piece of
cake. sorry I can't find them :(
 
Thank George this will help.

Momo


George Durzi said:
Crap! I did this a few years ago but don't have the code anymore ... But
here's the idea, you're gonna have to hunt down and find the stuff though.

I got a hold of a database of every US zip code geocoded. So every zip code
had a Lat and a Long.

There's a simple formula to measure the distance (as the crow flies) between
two co-ordinates on the earth. The original formula is complex because it
takes into account the curvature of the earth, but in it's simplified form,
it gives good results with a very acceptable (small) margin of error.

Let's use the example of car dealerships, you have a table of them, with a
zip code for each.

Since you have your search zip code, you can lookup its Lat and Long, and
perform a search of all "car dealerships" within x miles of your search zip
code.

Having the formula and the zip code geocode table makes this a piece of
cake. sorry I can't find them :(
 
momo said:
Can anyone help me? I am writing an ASP.NET app. and I need to be able to
have people search based on X radius of a zip code. Please help.

Thanks,

Momo

KJL Software has a free Distance DLL on the freeware page
(www.kjlsoftware.com/freeware.html). You pass a from lat/lon and a to
lat/lon and it returns the distance

HTH

JL
 
Back
Top