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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Searching by mapping coordinates - longitude and latitude
Pages: [1]

Author Topic: Searching by mapping coordinates - longitude and latitude  (Read 2380 times)

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
Searching by mapping coordinates - longitude and latitude
March 27, 2008, 12:59:51 pm
Any suggestions for how we can put in a series of geocodes (longitude and latitude) that would define a polygon (ie a space) and search for the contacts within that space?
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 by mapping coordinates - longitude and latitude
March 27, 2008, 01:15:50 pm

1. hire someone who is good at geo math and coordinate geometry :)

2. check out the drupal location module: http://drupal.org/project/location (which is currently in transition). I think there is some code in there which you could potentially reuse to get answers for "gimme all the contacts who live in a 5 km radius from these coordinates (its a circle, so its just a radial distance check which is a wee bit easier that a polygon check :)

3. Take the above code and create a custom search.

4. Post back the code on the forum for us to read and admire :)

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 by mapping coordinates - longitude and latitude
March 28, 2008, 09:22:32 pm
Yep - doing my best to identify OS solutions that require minimal tinkering - found http://www.zonums.com/gmaps/digipoint.html which basically seems to do what i am looking for in terms of being able to grab the coordinates that define the polygon (though it doesn't draw the lines) and output a csv or kml file.
Now just have to see how much messing it takes to query civi in terms of coordinates which fit within the defined area.
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 by mapping coordinates - longitude and latitude
March 28, 2008, 09:58:12 pm

this seems a bit interesting, so i did some search to see the potential solutions for this. here are a few useful links i found:

  • http://www.sqljunkies.com/Forums/ShowPost.aspx?PostID=8833
  • http://www.hackszine.com/blog/archive/2008/03/point_polygon_intersection_in.html
  • http://www.car-chase.net/2008/mar/17/point-poly-using-mysql-and-python/

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Searching by mapping coordinates - longitude and latitude

This forum was archived on 2017-11-26.