That doesn't look right to me. This page has some formulae that might
help and is pretty straightforward (as much as this stuff can be,
anyway)
http://www.movable-type.co.uk/scripts/latlong.html

(yeah, movable type--go figure)

On Mon, Mar 9, 2009 at 10:43 AM, Kyle Decot <[email protected]> wrote:
>
> I am trying to create a search by distance feature using the Geocoded
> behavior but I am having an odd problem. Whenever I search for
> something, no results are returned unless I change the radius to
> something incredibly high like 6000 miles. I looked at the query that
> it is creating and it is saying that all my locations are anywhere
> from 5000 miles to 9000 miles away! Here is the query I used to find
> how far away everything is from my location. It's just a simplified
> version of what the geocoded behavior is making.
>
> SELECT (3958 * 3.1415926 * SQRT((`Skatepark`.`lat` - -82.713132) *
> (`Skatepark`.`lat` - -82.713132) + COS(`Skatepark`.`lat` / 57.29578) *
> COS(-82.713132 / 57.29578) * (`Skatepark`.`lon` - 39.8141202) *
> (`Skatepark`.`lon` - 39.8141202)) / 180) AS distance,Skatepark.id FROM
> skateparks as Skatepark ORDER BY Distance ASC
>
> I'm not sure why this is happening. Any thoughts?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to