CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Pre-installation Questions (Moderator: Dave Greenberg) »
  • Searching for users in a geographic location
Pages: [1] 2

Author Topic: Searching for users in a geographic location  (Read 4687 times)

bsimbeck

  • Guest
Searching for users in a geographic location
April 26, 2008, 11:27:27 am
I am looking at implimenting this for my non-profit and we want to be able to contact users within a specific geographic location (say all contacts/users within 50 miles of Pittsburgh, PA. I know CIVICRM has geocoding capibilites but I wasn't sure if it was capibile of this.

Technology

Joomla 1.5
PHP 4 & 5
MySQL 5

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Searching for users in a geographic location
April 26, 2008, 12:21:01 pm

This is not available in the current search, but would make a great custom search component. There is some code in the drupal location module to do a geographic search, so you might be able to reuse parts of the code from there

You can find information on custom search on the wiki: http://wiki.civicrm.org/confluence/display/CRMDOC/Custom+Search+Components

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Searching for users in a geographic location
April 26, 2008, 02:52:19 pm
There is a bit of discussion here http://forum.civicrm.org/index.php/topic,2884.msg12526.html and here http://forum.civicrm.org/index.php/topic,3165.msg13901.html
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Searching for users in a geographic location
April 26, 2008, 09:05:01 pm
bsimbeck, if you do start work on this, I'd be very keen to hear your progress and possibly collaborate. I'm getting quite familiar with Custom Search now, but geocoding is new ground for me.
@xurizaemon ● www.fuzion.co.nz

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Searching for users in a geographic location
April 27, 2008, 03:44:52 pm

I took a look at the location module and started porting the code over to a custom search. You can check the progress here:

http://biryani.osuosl.org:8181/browse/CiviCRM/trunk/CRM/Contact/Form/Search/Custom/Proximity.php#btrunk

It is not complete as of yet, but i did not want people to duplicate effort. This is just a port from the location module, so i'm hoping that does work and we dont have to debug it (i dont comprehend all the math in there as yet)

If you want to move forward and complete this, sync up with me on IRC. I'll be on it based on my free time, but have made a fair bit of progress :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Searching for users in a geographic location
April 28, 2008, 02:35:15 am

I did some testing with this on the sample db and things look quite good. This will be part of the 2.1 release. You can get a copy of the code at:

http://svn.civicrm.org/civicrm/trunk/CRM/Contact/Form/Search/Custom/Proximity.php

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Searching for users in a geographic location
April 28, 2008, 02:59:09 am
Sounds like you have been having fun. Does this mean it is on the Demo site? If not I probably won't get to play for a day or so.

While it is fresh in your mind, can you see what would be required to shift from querying for a radius, to querying for a set of defined coordinates that would make a polygon? Or is this covered by what you have done (cross-fingers)
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Searching for users in a geographic location
April 28, 2008, 03:06:47 am

No, this is not on the demo site. its on the 2.1 site

i did go and check the polygon queries to see how easy that would be. thats a bit more involved, since you need to store the polygon description in a separate table. so thats a project for another day :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bsimbeck

  • Guest
Re: Searching for users in a geographic location
April 29, 2008, 03:50:32 pm
I will definately look at that.

You guys rock!

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Searching for users in a geographic location
June 13, 2008, 09:37:10 pm
Hey lobo - i know chris never got around to trying to put this in to 2.0 - before I try pushing on that again, is 2.1 sandbox somewhere I can go see how it works. if so where do i find it? can't see if via AdvSearch or Search Builder - is it missing a UI - and if so is it likely to get one before release? cheers
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Searching for users in a geographic location
June 14, 2008, 02:21:50 am

I just updated sandbox. Also custom search has a new listing interface: http://sandbox.civicrm.org/civicrm/contact/search/custom/list?reset=1

You can try it from there. We dont have a google map key for sandbox, so u'll need to add that if you want to try proximity searching (since it needs to geocode the address u want etc)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Searching for users in a geographic location
June 14, 2008, 03:44:09 am
That looks great - and like the 'access keys' - very helpful.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Searching for users in a geographic location
June 14, 2008, 03:06:48 pm
I presume I can just do an import with some GeoCode1 and 2 fields to get round lack of google key (since i don't know what is involved in the latter).
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Searching for users in a geographic location
June 14, 2008, 04:11:54 pm
Ok - set up Google key on sandbox - all is good - this is awesome - and really pleased to see it can go down to way small radius distance. makes it very useful for us to quickly find someone who is very close to something we may be interested in. way to go!!

will get chris on to putting it in to our 2.0. (well along with everything else on his list)

some of my users owe you a really fine bottle of wine!
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Searching for users in a geographic location
June 15, 2008, 01:31:24 pm
in sandbox, lots of my records showed in the search results as (   Adamek, Sonja ( altered ))
I was surprised to see that now showing on our version when i use the proximity search

what is the 'altered'?

thanks
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Pre-installation Questions (Moderator: Dave Greenberg) »
  • Searching for users in a geographic location

This forum was archived on 2017-11-26.