question about radius searches

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

    question about radius searches

    Hi Group, I'm trying to use the longitude and latitude to do a radius
    search but I'm getting some inaccurate results, below is the code and I
    was wondering if anyone knows weather or not I'm doing the calculations any
    feed back is much appreciated. Thanks Todd


    class RadiusAssistant {

    var $maxLat;
    var $minLat;
    var $maxLong;
    var $minLong;

    function RadiusAssistant ($Latitude, $Longitude, $Miles) {
    global $maxLat,$minLat ,$maxLong,$minL ong;
    $EQUATOR_LAT_MI LE = 69.172;
    $maxLat = $Latitude + $Miles / $EQUATOR_LAT_MI LE;
    $minLat = $Latitude - ($maxLat - $Latitude);
    $maxLong = $Longitude + $Miles / (cos($minLat * M_PI / 180) *
    $EQUATOR_LAT_MI LE);
    $minLong = $Longitude - ($maxLong - $Longitude);
    }

    function MaxLatitude() {
    return $GLOBALS["maxLat"];
    }
    function MinLatitude() {
    return $GLOBALS["minLat"];
    }
    function MaxLongitude() {
    return $GLOBALS["maxLong"];
    }
    function MinLongitude() {
    return $GLOBALS["minLong"];
    }

    }


  • R. Rajesh Jeba Anbiah

    #2
    Re: question about radius searches

    "Stormkid" <bakert2@golden gate.net> wrote in message news:<405f13e8$ 0$49105$8f4e799 2@newsreader.go ldengate.net>.. .[color=blue]
    > Hi Group, I'm trying to use the longitude and latitude to do a radius
    > search but I'm getting some inaccurate results, below is the code and I
    > was wondering if anyone knows weather or not I'm doing the calculations any
    > feed back is much appreciated. Thanks Todd[/color]
    <snip>

    1. http://www.census.gov/cgi-bin/geo/gisfaq?Q5.1
    2. http://www.phparchitect.com/sample.p...show=316&mid=9

    --
    http://www.sendmetoindia.com - Send Me to India!
    Email: rrjanbiah-at-Y!com

    Comment

    Working...