Check this out. http://www.doctrine-project.org/documentation/manual/1_1/en/behaviors#core-behaviors:geographical
- Jon On Mon, Jun 29, 2009 at 4:27 PM, oweit...@gmx.de <oweit...@gmx.de> wrote: > > try rhis link > > http://codeidol.com/sql/sql-hack/Number-Crunching/Calculate-the-Distance-Between-GPS-Locations/ > > On 29 Jun., 21:32, justin_davis <jdavis1...@gmail.com> wrote: > > Hey all - > > > > I've been working on getting this implemented for awhile, and can't > > figure it out. I want my users to be able to search by proximity > > (i.e. show all the records within X miles from the user). My table > > has lat/long columns, and getting that data in there is fairly easy > > (using Google maps API to populate data when the object is created). > > However, for the life of me, I can't figure out how to do the query. > > > > I know there are two options available, somewhat out of the box: the > > Doctrine Geolocatable behavior and Centre{Source}'s plugin: > > csDoctrineActAsGeolocatablePlugin. > > > > Neither of them offer much in the way of instruction when it comes to > > creating queries. Here is my current query (and pager): > > > > $q = Doctrine_Query::create() > > ->from('Profile p') > > ->where('p.bio NOT LIKE ?', ""); // do not return > objects where > > the bio is left blank > > > > $this->pager->setQuery($q); > > $this->pager->setPage($request->getParameter('page', 1)); > > $this->pager->init(); > > > > Anyone have any snippets or advice as to how to implement a radius/ > > geographic search into this? Thanks so much! > > > > Justin Davis > > > > -- Jonathan H. Wage (+1 415 992 5468) Open Source Software Developer & Evangelist sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org You can contact Jonathan about Doctrine, Symfony and Open-Source or for training, consulting, application development, or business related questions at jonathan.w...@sensio.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---