systopia / de.systopia.osm

CiviCRM OpenStreetmap GeoCoding-Provider
2 stars 17 forks source link

UK address lookups fail because CiviCRM StateProvince field doesn't match the state parameter in Open Street Map #17

Closed reswild closed 4 years ago

reswild commented 4 years ago

This extension passes along the value of the StateProvince field in CiviCRM as the 'state' parameter when doing address lookups, but this doesn't always match how addresses are registered in Open Street Map. For the UK, the default CiviCRM configuration is to populate the StateProvince field with UK counties, but in Open Street Map, UK states are instead defined as England, Scotland or Wales, and for some reason, this causes address lookups to fail. Often no addresses are found when the county is present in the address, or occasionally a completely wrong address is found.

On my own site, I have patched the extension to ignore the StateProvince field for UK addresses, but we should maybe look for a more sophisticated solution for this issue.

bjendres commented 4 years ago

For the UK, the default CiviCRM configuration is to populate the StateProvince field with UK counties, but in Open Street Map, UK states are instead defined as England, Scotland or Wales, and for some reason, this causes address lookups to fail

Hm... To me it sounds like it would be a good idea to create an exception for the UK, as I haven't heard from any other countries where this sort of thing is causing issues.

@reswild Would you create a PR?

reswild commented 4 years ago

I did some more testing on this, and I wasn't able to reproduce this on correct and up-to-date addresses, so I'm not sure if it's worth adding an exception for this. I still got some errors on some old addresses in my database that included no-longer-valid postal counties.

bjendres commented 4 years ago

Ok, thanks @reswild. I'll close the ticket then. For now, anyway.