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