long lat radius query problem
User:
esayward
Date: 12/18/2011 2:03 pm
Date: 12/18/2011 2:03 pm
Views: 664
Rating: 0
Rating: 0
for the life of me, I figure out why this msql query is returning nothing.. I have a table called zips, and in this table I have the longitue and latitude for every zipcode.. I should be able to do a radius search based on this query.. I might be missing something, thought I could bounce it off you..query: SELECT * FROM zips WHERE 3963.191 * ACOS((SIN(PI() * 49.25 / 180) * SIN(PI() * latitude / 180)) + (COS(PI() * 49.25 / 180) * cos(PI() * latitude / 180) * COS(PI() * longitude / 180 - PI() * -122.95 / 180)) ) <= 10also, the blue is the latitude cords and the maroon is the longitude..-Eric
Re: long lat radius query problem
User:
mcholste
Date: 12/18/2011 5:41 pm
Date: 12/18/2011 5:41 pm
Views: 148
Rating: 0
Rating: 0
This?
http://zcentric.com/2010/03/11/calculate-distance-in-mysql-with-latitude-and-longitude/
On Sun, Dec 18, 2011 at 2:03 PM, wrote:
> esayward wrote:
>
> for the life of me, I figure out why this msql query is returning nothing..
> I have a table called zips, and in this table I have the longitue and
> latitude for every zipcode.. I should be able to do a radius search based on
> this query.. I might be missing something, thought I could bounce it off
> you..
>
> query: SELECT * FROM zips WHERE 3963.191 * ACOS((SIN(PI() * 49.25 / 180) *
> SIN(PI() * latitude / 180)) + (COS(PI() * 49.25 / 180) * cos(PI() * latitude
> / 180) * COS(PI() * longitude / 180 - PI() * -122.95 / 180)) ) <= 10
>
> also, the blue is the latitude cords and the maroon is the longitude..
>
> -Eric
>
>
> View Online
>
>
>
> Madison Area Perl Mongers - MadMongers
> http://www.madmongers.org
http://zcentric.com/2010/03/11/calculate-distance-in-mysql-with-latitude-and-longitude/
On Sun, Dec 18, 2011 at 2:03 PM, wrote:
> esayward wrote:
>
> for the life of me, I figure out why this msql query is returning nothing..
> I have a table called zips, and in this table I have the longitue and
> latitude for every zipcode.. I should be able to do a radius search based on
> this query.. I might be missing something, thought I could bounce it off
> you..
>
> query: SELECT * FROM zips WHERE 3963.191 * ACOS((SIN(PI() * 49.25 / 180) *
> SIN(PI() * latitude / 180)) + (COS(PI() * 49.25 / 180) * cos(PI() * latitude
> / 180) * COS(PI() * longitude / 180 - PI() * -122.95 / 180)) ) <= 10
>
> also, the blue is the latitude cords and the maroon is the longitude..
>
> -Eric
>
>
> View Online
>
>
>
> Madison Area Perl Mongers - MadMongers
> http://www.madmongers.org
Re: long lat radius query problem
User:
esayward
Date: 12/18/2011 8:04 pm
Date: 12/18/2011 8:04 pm
Views: 0
Rating: 0
Rating: 0
http://www.truthertools.com/zipradius.cgi <-
here's what I have.. it's not broken but just doesn't seem to kick back any
results..
----- Original Message -----From: mcholste@gmail.comTo: admin@wisbin.comSent: Sunday, December 18, 2011 5:41 PMSubject: [MadTalk] Re: long lat radius query problemmcholste wrote:
This?
http://zcentric.com/2010/03/11/calculate-distance-in-mysql-with-latitude-and-longitude/
On Sun, Dec 18, 2011 at 2:03 PM, wrote:
> esayward wrote:
>
> for the life of me, I figure out why this msql query is returning nothing..
> I have a table called zips, and in this table I have the longitue and
> latitude for every zipcode.. I should be able to do a radius search based on
> this query.. I might be missing something, thought I could bounce it off
> you..
>
> query: SELECT * FROM zips WHERE 3963.191 * ACOS((SIN(PI() * 49.25 / 180) *
> SIN(PI() * latitude / 180)) + (COS(PI() * 49.25 / 180) * cos(PI() * latitude
> / 180) * COS(PI() * longitude / 180 - PI() * -122.95 / 180)) ) <= 10
>
> also, the blue is the latitude cords and the maroon is the longitude..
>
> -Eric
>
>
> View Online
>
>
>
> Madison Area Perl Mongers - MadMongers
> http://www.madmongers.org
Madison Area Perl Mongers - MadMongers
http://www.madmongers.org
Re: long lat radius query problem
User:
esayward
Date: 12/19/2011 12:16 pm
Date: 12/19/2011 12:16 pm
Views: 0
Rating: 0
Rating: 0
well, I figured it out.. let me know what you
think.. http://www.truthertools.com/zipradius.cgi
----- Original Message -----From: mcholste@gmail.comTo: admin@wisbin.comSent: Sunday, December 18, 2011 5:41 PMSubject: [MadTalk] Re: long lat radius query problemmcholste wrote:
This?
http://zcentric.com/2010/03/11/calculate-distance-in-mysql-with-latitude-and-longitude/
On Sun, Dec 18, 2011 at 2:03 PM, wrote:
> esayward wrote:
>
> for the life of me, I figure out why this msql query is returning nothing..
> I have a table called zips, and in this table I have the longitue and
> latitude for every zipcode.. I should be able to do a radius search based on
> this query.. I might be missing something, thought I could bounce it off
> you..
>
> query: SELECT * FROM zips WHERE 3963.191 * ACOS((SIN(PI() * 49.25 / 180) *
> SIN(PI() * latitude / 180)) + (COS(PI() * 49.25 / 180) * cos(PI() * latitude
> / 180) * COS(PI() * longitude / 180 - PI() * -122.95 / 180)) ) <= 10
>
> also, the blue is the latitude cords and the maroon is the longitude..
>
> -Eric
>
>
> View Online
>
>
>
> Madison Area Perl Mongers - MadMongers
> http://www.madmongers.org
Madison Area Perl Mongers - MadMongers
http://www.madmongers.org