473,396 Members | 2,002 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,396 software developers and data experts.

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,$minLong;
$EQUATOR_LAT_MILE = 69.172;
$maxLat = $Latitude + $Miles / $EQUATOR_LAT_MILE;
$minLat = $Latitude - ($maxLat - $Latitude);
$maxLong = $Longitude + $Miles / (cos($minLat * M_PI / 180) *
$EQUATOR_LAT_MILE);
$minLong = $Longitude - ($maxLong - $Longitude);
}

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

}
Jul 17 '05 #1
1 1581
"Stormkid" <ba*****@goldengate.net> wrote in message news:<40***********************@newsreader.goldeng ate.net>...
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

<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
Jul 17 '05 #2

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

Similar topics

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...
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...
4
by: John Cho | last post by:
Class Cartesian { double x; double y; public: Cartesian( ) { x = 0.0 ; y = 0.0;} Cartesian(double x1, double y1) { x = x1; y = y1;} }; class Polar { double radius;
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
24
by: arcticool | last post by:
I had an interview today and I got destroyed :( The question was why have a stack and a heap? I could answer all the practical stuff like value types live on the stack, enums are on the stack, as...
0
by: cmbardon | last post by:
I'm trying to create a form with some rounded controls, and I'm having some problems with the rounding not working correctly. I've tried a couple of different methods for creating the graphics...
3
by: bayan1 | last post by:
/*The following program have the following output. write the necessary code to make it works? Code :*/...
5
by: javatech007 | last post by:
Hi, I've been at this question all day and still just don't know what to do. It's the last of all the questions I have to do and can't figure it out!! If anyone could help or give guidance it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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,...
0
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...

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.