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) »
  • Geo_Code_1 ... and accuracy
Pages: [1]

Author Topic: Geo_Code_1 ... and accuracy  (Read 731 times)

sggreener

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 0
    • The SpatialDB Advisor
  • CiviCRM version: 4.6.15
  • CMS version: Joomla 5.5.1
  • MySQL version: 5.6.29
  • PHP version: 5.3.8
Geo_Code_1 ... and accuracy
June 14, 2012, 06:29:13 pm
I want to load a lot of latitude/longitude data into the geo_code_1 and geo_code_2 fields.

This is straightforward.

However, I wish to associate with that coordinates an accuracy flag (values 1-9).

I can create an "accuracy" custom field with combo box (easy) but I would like to have this field associated with the geo_code_1 and _2 fields on the contact input address form.
Also from a data management point of view I would like to put that accuracy field in the civicrm_address table but can understand if that is not possible.

So, questions are:

1. Is it possible to add a custom field to civicrm_address?
2. Regardless, can I associate the new custom field "accuracy" with the latitude/longitude input boxes on the address form of the contact create/update form? If so, how?

I have temporarily created a new set of custom fields called Mapping which has Latitude/Longitude/Accuracy fields. The problem with this is that the inbuilt geocoding engine fills in the geo_code_1 etc fields and not my latitude/longitude fields. I could create a database trigger to copy them across and keep them in sync but it would be nice to be able to tell CiviCRM to use my fields and not its geo_code_1/2 fields. Also, if I used my custom field set Mapping I would want to hide the current geo_code_1/2 fields.

Comments?

regards
Simon

noneother

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Geo_Code_1 ... and accuracy
June 15, 2012, 04:51:13 pm
You could always use civicrm hooks to update your custom fields when the geo_code_1 and geo_code_2 field are edited.

You can then hide geo_code_1 and geo_code_2 by going to "Administer -> Localization -> Address Settings" and uncheck Latitude and Longitude.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Geo_Code_1 ... and accuracy
June 17, 2012, 09:39:11 am
In recent versions you can do this via admin UI. Just add a custom data set Used For = Addresses. Then add your Accuracy multiple choice field.

Example here on demo (until demo db is reset in any case):
http://drupal.demo.civicrm.org/civicrm/admin/custom/group/field?reset=1&action=browse&gid=7
http://drupal.demo.civicrm.org/civicrm/contact/add?reset=1&action=update&cid=102
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Geo_Code_1 ... and accuracy

This forum was archived on 2017-11-26.