1

I'm noticing that the proximity search doesn't seem to work quite as well on towns as it does for postcodes.

I've seen this behaviour sporadically. For some contacts it's not an issue, for others it is.

For instance, if I do a search for 30km around Chester it won't find a person who's in Chester, but will find them if I search for postcode CH2.

In this case, the contact's address is simply 'Chester, Cheshire, UK', with no postcode supplied. Nevertheless, the Map icon in their contact record is successfully placing them in the middle of Chester.

The same occurs for other contacts with the same non-specific Chester address.

However, it doesn't occur for other contacts with similar address formats if they are in nearby towns. For instance, people with addresses such as 'Liverpool, Merseyside, UK' are found by the above search.

Having said that, if I then do a search for 30 km around Liverpool, I do get correct results!

We are using Google as our Geocode provider, Civi 5.3.1, Drupal 7.58.

Could it be that the Proximity search fails if the distance from certain towns is zero? And works for other towns? Or something else?

Does anyone have a suggestion where I should look to fix this? Or is it a known issue with the proximity search?

Thanks!

1
  • I have this issue. City gives inconsistent results but ZIP code works fine. I'm using the wikimedia geocoder extension.
    – Zachary
    Commented Apr 25, 2019 at 17:33

1 Answer 1

2

I've had something like this come up and so when I looked at what CiviCRM was doing I noticed it doesn't use all the available fields. For example it uses City but not County. It also only uses the first line of the street address, so depending on what you have there it may actually return nothing even though city, postal code, etc without the street address would work.

You can see what fields it's combining here: https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/Geocode/Google.php

You can also put the contact's address into maps.google.com directly and see what it returns, to help troubleshoot.

1
  • Thanks @Demerit, that's really helpful. I'll update here if I find anything that further clarifies this.
    – Andyg8
    Commented Aug 4, 2018 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.