Answers.Body: <p>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.</p>
  
  <p>You can see what fields it's combining here:
  <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/Geocode/Google.php" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/Geocode/Google.php</a></p>
  
  <p>You can also put the contact's address into maps.google.com directly and see what it returns, to help troubleshoot.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-04T11:37:24.927Z
Answers.Text: Thanks @Demerit, that's really helpful. I'll update here if I find anything that further clarifies this.
Answers.UserDisplayName: Andyg8
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-01T22:16:38.647Z
Answers.LastActivityDate: 2018-08-01T22:16:38.647Z
Answers.UserDisplayName: Demerit
Body: <p>I'm noticing that the proximity search doesn't seem to work quite as well on towns as it does for postcodes. </p>
  
  <p>I've seen this behaviour sporadically. For some contacts it's not an issue, for others it is. </p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>The same occurs for other contacts with the same non-specific Chester address.</p>
  
  <p>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. </p>
  
  <p>Having said that, if I then do a search for 30 km around Liverpool, I do get correct results! </p>
  
  <p>We are using Google as our Geocode provider, Civi 5.3.1, Drupal 7.58. </p>
  
  <p>Could it be that the Proximity search fails if the distance from certain towns is zero? And works for other towns? Or something else?</p>
  
  <p>Does anyone have a suggestion where I should look to fix this? Or is it a known issue with the proximity search?</p>
  
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-25T17:33:04.360Z
Comments.Text: I have this issue. City gives inconsistent results but ZIP code works fine. I'm using the wikimedia geocoder extension.
Comments.UserDisplayName: Zachary
Tags: <custom-search>
Title: Proximity search doesn't always work for towns
ThreadText: # Proximity search doesn't always work for towns
  
  (Asked by: username_0 on 2018-08-01)
  
  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!
  
  **Tags:** custom-search
  
  > **Comments:**
  > **username_1**: I have this issue. City gives inconsistent results but ZIP code works fine. I'm using the wikimedia geocoder extension.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-08-01. Score: 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.
  
  > **Comments:**
  > **username_0**: Thanks @username_2, that's really helpful. I'll update here if I find anything that further clarifies this.  
  
  ---
  
  