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) »
  • Command-line geocoding script seemingly does nothing
Pages: 1 [2]

Author Topic: Command-line geocoding script seemingly does nothing  (Read 4942 times)

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Command-line geocoding script seemingly does nothing
June 01, 2008, 01:13:33 pm
Think I figured it out. From the Google FAQ:

Quote
If more than 15,000 geocodes requests in a 24 hour period are received from a single IP address, or geocode requests are submitted from a single IP address at too fast a rate, the Maps API geocoder will begin responding with a status code of 620. If excessive geocoder usage continues, access to the Maps API geocoder from this IP address may be blocked permanently.

Yikes. This would explain why 14,000 or so out of 30,000 voter records returned values of 0 and subsequent runs of the script zeroed out everything. So it looks like I'm banned from Google mapping; Yahoo seems to be OK on a record-by-record basis. We'll see what happens if I try to run the script. Live and learn.

Thank you SO much for your help...


bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Command-line geocoding script seemingly does nothing
June 06, 2008, 08:35:45 pm
OK - here's the deal as best as I know:

Google doesn't ban you permanently, as a rule. (They do offer an "Enterprise" package that allows unlimited mapping, but don't ask how much it costs!)

All the versions of the UpdateAddress.php I've tried from here give a result of "Addresses Evaluated: 0 Addresses Geocoded : 0" when run from the browser. When the script is run from the command line using wget, I get the following result and nothing happens:

Quote
Resolving www.domain.com... XX.XXX.XX.XXX
Connecting to www.domain.com|XX.XXX.XX.XXX|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 40 [text/html]
Saving to: `UpdateAddress.php?name=admin.6'

100%[================================================================>] 40          --.-K/s   in 0s     

21:53:10 (3.62 MB/s) - `UpdateAddress.php?name=admin.6' saved [40/40]

It may be that when the daily geocode allocation is exceeded, Google writes a 0 into the geocode, which CiviCRM "sees" (correctly) as being different from NULL, which is what UpdateAddress.php requires to see a "blank" geocode field. I had thought, then, that it would be necessary to perform an SQL command to change all geocode 0 values to NULL and try running the script again.

But...

I've noted that when a record with 0,0 geocode values is edited and saved, the location is calculated and the mapping then works fine. No values need to be changed for the contact. A simple save does the trick.

So... all I really would need to do is to find a way to re-save each contact with any geocode value of 0.

With over 18,000 unmapped contacts, this is obviously impractical - is there a command to do this? I would think that other people would be running into the same problem if trying to use CiviCRM to manage voter lists and a simple solution would be most welcome - and suggestions?

Thanks, as always, for taking the time. I'm hoping this is the last major problem I'll have here...

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: Command-line geocoding script seemingly does nothing
June 06, 2008, 09:31:22 pm

Check: http://fisheye.civicrm.org/rdiff/CiviCRM?csid=14974&u&N

i've fixed the UpdateAddress script to also re-geocode values that are 0. this should help you make 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

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Command-line geocoding script seemingly does nothing
June 07, 2008, 01:13:32 pm
That's probably a good idea anyway (except for the fish that may be living at 0,0), but unfortunately, there's no change. Running the script via wget produces the same result as in previous post (which does not look right at all) and running the script from a browser (FF) seems to do something for about a minute and then it asks you whether you want to download the UpdateAddress.php file.

The downloaded file contains no data.

Considering what's happened before, I'm reticent to try running the script again.

The result I get from running the script using wget looks odd - is there a clue there? This is maddening. Thanks, as always...

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Command-line geocoding script seemingly does nothing

This forum was archived on 2017-11-26.