[TYPO3-mvc] How would you realize a radius search

Xavier Perseguers xavier at typo3.org
Tue Feb 19 09:50:37 CET 2013


Hi,

Philipp wrote:
> Hy, how would you do - in etxbase - a radiussearch? What is the best
> approach?
> Executing Raw queries?
> Set a distance property in the model, that will be updated manually, 
> get all Data and then extract those with the lowest distance?
> Get all matching and then order them by distance using a controller action?
> 
> Or could i write a extension for extbase itself?
> 
> What i would need is to add a field to my result called distance and
> order my results by that field. Is there a nice way to do this in extbase?

Unless you have proper spatial support in your database I would suggest
to do it in a 2-pass algorithm, first filter records with a SQL query
using a rectangular area (min/max latitude/longitude) and only then
calculate the real distance to further trim-down the result set.

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-project-typo3v4mvc mailing list