473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

checking the radius in a web site

Hello,

How do I check the radius for a user if they come to my web site and I
want to find out how far certain churches are from where they live.
For instance, display results for churches that are within 25 miles of
where the person lives?

Thank you any help with this.

Aaron;
Jul 17 '05 #1
4 2175
>want to find out how far certain churches are from where they live.
For instance, display results for churches that are within 25 miles of
where the person lives?


Some web sites ask for a Zip code (assuming this is in the USA) and
translate this to a set of coordinates for the center of that Zip
code. Then you calculate the distance between that point and the
known coordinates of the churches to select the close ones.

It may be to your advantage to precalculate some of this, especially
if the radius is ALWAYS 25 miles. For each church, calculate a
list of Zip codes with a center point within 25 miles. Populate
the database with that info, and you don't have to do any distance
calculations once you've set up the data. Just look up the churches
close to the zip code in question.

You can use any coordinate system you want. For a large radius
(like 1000 miles), you may need to use latitude/longitude degrees
and the appropriate distance formula. For a smaller radius, where
the curvature of the Earth is not relevant, coordinates on any map
grid and the usual distance formula:

r = (x2-x1)**2 + (y2-y1)**2

is fine.

I have heard rumors of a Zip-code-to-coordinates database. I think
the info in the Bureau of the Census TIGER data could be used to
derive one, but it's really too detailed for direct use (but it
could possibly be used to translate street addresses to coordinates
at the street block level, but it likely requires a very clever
parser). TIGER data for some of the larger counties in Texas is
2-4 megabytes of .zip file.

Gordon L. Burditt
Jul 17 '05 #2
"Aaron Collins" <fi****@smartwebdevelopment.com> wrote in message
news:ef**************************@posting.google.c om:
Hello,

How do I check the radius for a user if they come to my web site and I
want to find out how far certain churches are from where they live.
For instance, display results for churches that are within 25 miles of
where the person lives?

Thank you any help with this.

Aaron;


This was covered in the php|architect magazine in the May 2003 issue.
The issue can be downloaded for free on their website at
http://phparch.com/issue.php?mid=9

---
Mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.778 / Virus Database: 525 - Release Date: 15/10/2004
Jul 17 '05 #3
Hello,

"Aaron Collins" <fi****@smartwebdevelopment.com> wrote in message:
How do I check the radius for a user if they come to my web site and I
want to find out how far certain churches are from where they live.
For instance, display results for churches that are within 25 miles of
where the person lives?


If you are in the US and you have a database of zip codes of all the
known churches, you may want to try any of these classes that provide
solutions for locating the entries that are located within the range of
distance from a given user zip code:

Class: php Zip Locator
http://www.phpclasses.org/phpziplocator

Class: Zip Codes Range
http://www.phpclasses.org/zipcodesrange
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #4
Manuel Lemos <ml****@acm.org> wrote in message news:<41**************@acm.org>...
Hello,

"Aaron Collins" <fi****@smartwebdevelopment.com> wrote in message:
How do I check the radius for a user if they come to my web site and I
want to find out how far certain churches are from where they live.
For instance, display results for churches that are within 25 miles of
where the person lives?


If you are in the US and you have a database of zip codes of all the
known churches, you may want to try any of these classes that provide
solutions for locating the entries that are located within the range of
distance from a given user zip code:

Class: php Zip Locator
http://www.phpclasses.org/phpziplocator

Class: Zip Codes Range
http://www.phpclasses.org/zipcodesrange
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html


Thank you Manuel and everyone else who posted a response to my
question. I've downloaded the Zip Locator class written my Dr. Tarique
Sani and Girish Nair. I also enjoyed Dr. Sani's article in May 2003
PHP | Architect magazine. Thank you Kelvin for that link. This has
been a blast learning how to calculate distances, and I'm grateful for
everyone's input.

Aaron;
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bacci | last post by:
I'm creating a zip code radius search. I have a general understand of how this works, but am puzzled by how to get my final list of company locations. I have setup two database tables: one with...
4
by: Xenophobe | last post by:
I have successfully created a zip code radius search, but the performance is unacceptable. I have two tables. The first is 52K zip codes w/lat and long. The second is 3K national business...
2
by: Nazir | last post by:
Hi - I know this isn't really a specific SQL Server question but I can't think of a better forum. I want to implement a more sophisticated UK postcode search on a site - "LIKE 'NW%'" etc, is not...
1
by: Pietro | last post by:
Hi at all, I teach into a teachnical school and many boys must to know best CSS. I have two problems: 1)Making tables we'ld want make the cells with round angles. Therefore we apply ...
1
by: Marek Mänd | last post by:
<div style="border:1px solid red;-moz-border-radius:10px"> <div style="margin:0px;padding:0px;background:white;">this is titlebar for my box</div> This is content for my box </div> Is there...
1
by: twhan twhan via .NET 247 | last post by:
Hi, currently i am developing a Radius server application. Cananyone show me how can i unpack the "User-Password" attribute sothat i can get back the password in plain text so that i canverify it...
9
by: Sandy | last post by:
Hello - I need either a cheap tool or code & DB that calculates, eg. within 50-mile radius of a zip code. Anyone have any suggestions? -- Sandy
1
by: Chris Ochs | last post by:
Has anyone ever taken a look at adding radius authentication to Postgresql? I know it's not terribly secure in itself, but some 2 factor authentication schemes like Cryptocard use it for verifying...
7
by: pradeep_TP | last post by:
hello all, I want to know how can I check whether a web site us running or not. I have used HttpWebRequest but when I give a web site address, It takes few number of seconds to throw exception...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.