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 »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Triggering an event location geocode
Pages: [1]

Author Topic: Triggering an event location geocode  (Read 5964 times)

JulieR

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 5
Triggering an event location geocode
February 10, 2010, 04:16:50 am
I recently added the mapping capability to my installation, and it's working fine for contact addresses, but I found that event locations I created and saved before are mapped in the wrong place.  If I put the location's postcode directly into Google it shows the marker in the correct place, but CiviCRM maps it a couple of miles away. I've tried just saving the location data again, but it doesn't update.  Can I trigger an update somehow? Or where is the location's lat-long stored? Maybe I can edit the numbers?

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: Triggering an event location geocode
February 10, 2010, 08:07:12 am

1. if you dont have too many events, you can try editing and saving them again

2. You can also run the script: bin/UpdateAddress.php to geocode all addresses that have not been geocoded

3. the geocodes are stored in civicrm_address: geo_code_1 and geo_code_2

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

JulieR

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 5
Re: Triggering an event location geocode
February 10, 2010, 09:59:24 am
Thanks Lobo.  Saving again didn't work, but I used google maps to get the geocode x&y, and then manually edited the civicrm_address table. For others coming after, the event locations are in civicrm_address, they just have a NULL contact_id.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Triggering an event location geocode
February 10, 2010, 02:10:04 pm
Julie - Based on some quick tests on 3.1.1 - we do update the geocoding on an event location if you either modify the address OR empty the existing values in the Lat and Longitude fields.
Protect your investment in CiviCRM by  becoming a Member!

JulieR

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 5
Re: Triggering an event location geocode
February 11, 2010, 01:03:04 am
Thanks Dave, that gave me the clue to discover that my address settings were suppressing the lat & long display, which is why I couldn't interact with them directly.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Triggering an event location geocode
March 27, 2010, 03:00:17 am
Hi Julie,

just noticed this & I'm wondering what you mean. I've had to use some pretty heavy handed techniques to get events to geocode properly. We don't have many locations so it hasn't been too big a deal but obviously you figured out more about it than I did.

Eileen
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

JulieR

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 5
Re: Triggering an event location geocode
March 30, 2010, 01:57:35 pm
Eileen, I may have been unduly optimistic when I wrote that. Originally it had been clear that the geocode hadn't worked propely, but I thought that was because the event location had been there before I set up the geocode capability. I used Google to get the correct lat-long, but I couldn't see the event lat-log fields so couldn't change them, and I couldn't trigger it to change itself... so I did it manually in the database table. After Dave's comment I found out how to make the lat-long display in the event location record (by fixing the address settings) and assumed that clearing those fields would have solved the problem.  BUT... since then I entered a new location and again it geocoded wrongly (just a mile or so out, oddly enough), so it wasn't that after all.  Yet the contact addresses seem to geocode ok. It didn't seem reasonable that it could be a software error, so I just parked it to come back to (like you we don't have a lot of  locations).  But if you are having trouble too, perhaps there is something deeper going on....?

P.S. The geocode error seems to be only in the decimal part of the lat and long - perhaps the sort of thing that might happen if a 'minute' figure was misinterpreted as a decimal of a degree, or vice versa?
« Last Edit: March 30, 2010, 02:02:59 pm by JulieR »

JulieR

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 5
Re: Triggering an event location geocode
April 21, 2010, 06:20:51 am
Eileen, could you elaborate please what have you been doing to get events to geocode properly?  My fix didn't work - next time I used the location it just overwrote my manual geocode with the wrong location again.  Is this recognised as a bug?  I'm not sure I can isolate the problem well enough to be comfortable adding it to the issue tracker...

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Triggering an event location geocode
April 21, 2010, 12:38:21 pm
I can't remember - I may have changed it via phpmyadmin although I think I found that if I kept tinkering with the address I eventually found one it would accept.

Can you replicate it on the sandbox?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Re: Triggering an event location geocode
June 29, 2010, 04:10:30 am
Lobo,

You said the following:
2. You can also run the script: bin/UpdateAddress.php to geocode all addresses that have not been geocoded

If I do in my browser http://<domain>/civicrm/bin/UpdateAddress.php I get the civicrm front page and no addresses are update with their geocoding. How does this work?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Triggering an event location geocode
June 29, 2010, 04:34:23 am
it should be http://domain/sites/all/modules/civicrm/bin/UpdateAddress.php

if your code is in 'all'
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Re: Triggering an event location geocode
June 29, 2010, 04:39:37 am
pff, thanks, stupid from me  :-\

Colin Sagan

  • Guest
Re: Triggering an event location geocode
December 31, 2010, 05:48:44 pm
When I try going to /sites/all/modules/civicrm/bin/UpdateAddress.php I get the following error:

Code: [Select]
Console_Getopt: Could not read cmd args (register_argc_argv=Off?)
Do I need to specify arguments somehow?

I'm using 3.3.1.

Thanks!
Colin

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: Triggering an event location geocode
December 31, 2010, 08:05:37 pm

I suspect this is due to the behavior in php 5.3 and scripts vs web pages. Check this url:

http://drupal.demo.civicrm.org/sites/drupal.demo.civicrm.org/modules/civicrm/bin/UpdateAddress.php?name=demo&pass=demo

which is running php 5.2.x

i got the same error as u on 5.3.2

for now, i suspect the easiest option might be to run it from the command line. We'll need to fix that at some point. If you can take a look and submit a patch that allows both command line and web based invocation that would be great

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

kenlyle

  • I post occasionally
  • **
  • Posts: 116
  • Karma: 7
Re: Triggering an event location geocode
October 02, 2011, 09:29:54 am
I got the same error today on the Drupal 6.22 and Civi 3.4.6, and I have PHP 5.2.16

After running at the command line, I found that the sample data were geocoded, but I hadn't checked beforehand, maybe they come that way.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Triggering an event location geocode

This forum was archived on 2017-11-26.