News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



Martynas Jusevicius' Blog:
Calculating great-circle distance in MySQL and Propel
0 comments :: posted Thursday May 01, 2008 @ 16:08:27
voice your opinion now!

In a new post today, Martynas Jusevicius shows how to combine a little SQL magic with the Propel framework to fins the distance between two places:

Eventually the simple distance formula that I have blogged about turned out to be too inaccurate, even for locations within city bounds. I needed to use a formula to calculate great-circle distance which takes into account that the Earth is a sphere.

He includes the SQL to pull the data in the right format and the PHP code (using Propel) to reproduce it without having to write it by hand (complete with the bind variables to help with security and consistency).

tagged with: great circle distance mysql propel framework sql



release security application PEAR cakephp job package code ajax framework database pecl PHP5 mysql conference zend book releases developer zendframework

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework