> Anyone on the list have a handy copy of the formula
> required to find all the
> zip codes surrounding one Long/Lat location? I already
> have the Zips DB
> with long/lat info in it, I just need a quick query or
> stored proc that will
> return the radius and all the zips in it. I actually
> wrote a proc that did
> this long ago (sometime in 1999 or 2000?), and I might
> have even posted it
> to this list, but have since lost it.
> Anyone? Thanks!
Hi Cameron,
Here's a snippet from a query I wrote to do this just yesterday, along with
part of the instructions from the zip db the client purchased.
<!--- Approximate distance in miles = sqrt(x * x + y * y)
where x = 69.1 * (zip2.lat - zip1.lat)
and y = 69.1 * (zip2.lon - zip1.lon) * cos(zip1.lat/57.3) --->
SELECT sqrt(power(69.1 * (zip2.lat - zip.lat),2)
+ power(69.1 * (zip2.lon - zip.lon) * cos(zip.lat/57.3),2))
AS distance
hth
s. isaac dealey 954-776-0046
new epoch http://www.turnkey.to
lead architect, tapestry cms http://products.turnkey.to
tapestry api is opensource http://www.turnkey.to/tapi
certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4