I mean doing the calculations within the SQL queries. I've got this
far.
$c->addAsColumn('distance', '((ACOS(SIN('.$zipcode->getLat().' * PI
() / 180) * SIN(`walking_zipcodes`.LAT * PI() / 180) + COS('.$zipcode-
>getLat().' * PI() / 180) * COS(`walking_zipcodes`.LAT * PI() / 180) *
COS(('.$zipcode->getLon().' - `walking_zipcodes`.LON) * PI() / 180)) *
180 / PI()) * 60 * 1.1515)');
Good enough.
On Feb 27, 5:05 pm, Lee Bolding <[email protected]> wrote:
> I think he means using the MySQL geospacial functionality.
>
> TBH, I'm not entirely sure how you'd do this - interested to hear
> responses.
>
> I guess you'd use the generated models only for creating, updating and
> deleting - for reading you'd probably want to use raw SQL.
>
> On 27 Feb 2009, at 21:28, Eno wrote:
>
>
>
> > On Fri, 27 Feb 2009, Joshua wrote:
>
> >> I guess I could, but I think its more efficient to do the distance
> >> calculations directly in SQL so I wouldn't need the classes in that
> >> case, just the table data.
>
> > 'Directly in SQL' meaning what exactly? Straight PHP MySQL
> > functions? If
> > you're using Propel in symfony, seems to me to make no sense to use
> > straight PHP. After all, you would be duplicating with Propel does
> > for you
> > anyway.
>
> > --
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---