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

bernd wilke t3ng at bernd-wilke.net
Tue Feb 19 09:41:38 CET 2013


Am 19.02.2013 08:30, schrieb Philipp:
> 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?

the problem radiussearch needs more information to get the optimal solution.

having just a few locations, you might calculate the distance for all 
locations.
having a lot of locations you need another start: you can't calculate 
the distance to each location and sort it afterwards if you have more 
than 10000 locations.
A previous filtering is needed.
one possible solutions: preselect a country, or calculate all nearby 
zip-codes and do a real distance-calculation only on records with these 
zip-codes.

the other problem: getting the geoposition to a given address.


and by the way: normaly it is more performant to caclculate the distance 
by SQL than by PHP (at least depending on a max-execution-time)


and all that without dependency to extbase ;-)

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-project-typo3v4mvc mailing list