473,785 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2211
>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****@smartwe bdevelopment.co m> wrote in message
news:ef******** *************** ***@posting.goo gle.com:
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****@smartwe bdevelopment.co m> 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****@smartwe bdevelopment.co m> 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
9314
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 zip codes w/latitudes and longitudes and the other with company names and addresses. The user enters their zip code and the corresponding latitude and longitude is returned. I then use this to return a list of zips, latitudes and longitudes within...
4
3818
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 addresses. Using the zip code 10010, it takes almost 60 seconds to return 122 businesses within a 25 mile radius. This slowdown is almost entirely due to the query radius distance formula.
2
3284
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 bringing back good enough results. A feature that would allow me to ask: "give me all outward postcodes in a 30 mile radius of NW10" would be ideal. Has anyone had to do this before? - any advice on how much
1
3027
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 -moz-border-radius-topleft ecc...... But it work only with Netscape 6 or more. Is there the mean to do to work with MSIE? 2)What is the best CSS book?
1
1791
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 any hope the round borders can be fooled to show up?
1
3344
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 against my database. For example, the user entered password "testpassword". Assumethat the shared secret between the NAS and my radius server is"testshared". I am totally unfamiliar with .NET encryption (MD5,XOR), so please provide some sample codes if...
9
3447
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
1952
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 one time passwords, and at least in our case having 2 factor authentication for remote access would be really nice. ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the...
7
1804
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 if the web site is not running. Is there any easy method of doing the same. I do *not* want to use IP to ping and check the server. Thanks pradeep_tp
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.