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

Stephan Schuler Stephan.Schuler at netlogix.de
Tue Feb 19 13:18:04 CET 2013


Hi there.

I still don't get what you really want to have as a result. Of course if you're doing something like "traveling several waypoints, what's the shortest route that covers them all", then calculating each-to-each distances is kind of heavy.
But usually that's not a problem you face in a web application. At least it's unlikely.

The usual situation is: There are several POI, shops, for example. And you want to show those shops that are closest to your customer. No need for routing him between different POIs. The closest shop, or the closest couple of, is enough.

If that's what you trying to do: That's not too complicated.
http://stackoverflow.com/questions/4687312/querying-within-longitude-and-latitude-in-mysql

See the first answer.
Just drop this query inside of your repository. I don't know the current state of extbase QOM. So maybe you should fallback to RAW sql. As long as you don't plan to switch data base on the one hand and don't plan to publish your extension on the other hand, that's not too bad as it sounds, as long as it creates a fast and correct result.

As you can see, the 6371 and 3959 are magic numbers for kilometers and miles, 37 and -112 are the given customer latitude and longitude values.


Stephan Schuler

Web-Entwickler

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Website: media.netlogix.de


--
netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Andernacher Straße 53 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Internet: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Oliver Klee
Gesendet: Dienstag, 19. Februar 2013 11:34
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] How would you realize a radius search

Am 19.02.2013 11:03, schrieb Oliver Klee:
> At least for the second part, you can use the geocoding calculator in
> my oelib extension (trunk version):
>
> <https://svn.typo3.org/TYPO3v4/Extensions/oelib/trunk/Geocoding/Calcul
> ator.php>

This extension also provides a Service for using the Google geocoding.


Oli
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
 schrieb Oliver Klee:
> At least for the second part, you can use the geocoding calculator in
> my oelib extension (trunk version):
>
> <https://svn.typo3.org/TYPO3v4/Extensions/oelib/trunk/Geocoding/Calcul
> ator.php>

This extension also provides a Service for using the Google geocoding.


Oli
_I


More information about the TYPO3-project-typo3v4mvc mailing list