checking the radius in a web site

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron Collins

    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;
  • Gordon Burditt

    #2
    Re: checking the radius in a web site

    >want to find out how far certain churches are from where they live.[color=blue]
    >For instance, display results for churches that are within 25 miles of
    >where the person lives?[/color]

    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

    Comment

    • Kelvin Mackay

      #3
      Re: checking the radius in a web site

      "Aaron Collins" <findme@smartwe bdevelopment.co m> wrote in message
      news:effef7d4.0 410151755.361ae e2a@posting.goo gle.com:[color=blue]
      > 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;[/color]

      This was covered in the php|architect magazine in the May 2003 issue.
      The issue can be downloaded for free on their website at
      php[architect] is the monthly journal for PHP developers. Each issue is carefully curated and reviewed. A PHP magazine in print & digital editions.


      ---
      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


      Comment

      • Manuel Lemos

        #4
        Re: checking the radius in a web site

        Hello,

        "Aaron Collins" <findme@smartwe bdevelopment.co m> wrote in message:[color=blue]
        > 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?[/color]

        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


        Class: Zip Codes Range



        --

        Regards,
        Manuel Lemos

        PHP Classes - Free ready to use OOP components written in PHP
        Free PHP Classes and Objects 2025 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials


        PHP Reviews - Reviews of PHP books and other products


        Metastorage - Data object relational mapping layer generator

        Comment

        • Aaron Collins

          #5
          Re: checking the radius in a web site

          Manuel Lemos <mlemos@acm.org > wrote in message news:<4170A639. 1040704@acm.org >...[color=blue]
          > Hello,
          >
          > "Aaron Collins" <findme@smartwe bdevelopment.co m> wrote in message:[color=green]
          > > 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?[/color]
          >
          > 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[/color]

          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;

          Comment

          Working...