craue / CraueGeoBundle

Doctrine functions for calculating geographical distances in your Symfony project.
MIT License
124 stars 15 forks source link

Get distance in miles #18

Closed wisdom-17 closed 4 years ago

wisdom-17 commented 4 years ago

Hi,

I've implemented bundle successfully in my Symfony (3.4) project but want to know how I can override the geo query to return miles instead of kilometres.

Appreciate any advice

craue commented 4 years ago

To get a result in miles, use the appropriate conversion factor, like: GEO_DISTANCE(:latOrigin, :lngOrigin, :latDestination, :lngDestination) * 0.6213712

wisdom-17 commented 4 years ago

Thanks @craue, appreciate the help and work you've put into this bundle.

Now that you've provided the solution and seeing how simple it is, I feel silly for not figuring it out myself.