Performing Geospatial Calculations

Hi

I’m trying to figure out what’s the best way to perform geo-calculations on a mysql db. In the past I have crafted my own sql calc but I wonder if there is a better yii way? Whether by a module of some sort?

I found the post http://www.yiiframework.com/forum/index.php/topic/10578-do-i-need-to-escape-sql-queries/page__p__51975__hl__geo+patial#entry51975 but no final solution.

Thanks in advance