systopia / de.systopia.osm

CiviCRM OpenStreetmap GeoCoding-Provider
2 stars 17 forks source link

Proximity search to a distance of 20 miles from 3042, Victoria, Australia: We could not geocode the destination address. #12

Closed yurg closed 3 years ago

yurg commented 6 years ago

Well, it used to work with Google but seems it doesn't if we try Advanced search with country+state/province+postal code. Just wondering if it is something OSM - related ( we don't have OSM API key nor we are sure is required ) or it comes from the extension. Please advise. Thanks!

bjendres commented 6 years ago

Hi @yurg. The distance search only works if the addresses have been geocoded, i.e. latitude and longitude have been set. You should be able to see that in the UI.

Of course there are differences between different data sets, e.g. between Google's and OSM's. Therefore a different behaviour is not necessarily related to the extension itself.

If you want, you can try your address with https://nominatim.openstreetmap.org, which is the service that the extension uses as well. Let me know how it went. Cheers!

yurg commented 6 years ago

Hi @systopia , thank you for notes! Have tried https://nominatim.openstreetmap.org and it points to an exact location if only postcode and state/province being searched by: in our case it is "3205 Victoria".
On the other hand, around 365 of contacts in the DB has "Longitude" field empty, e.g.NOT geo-coded. SO I'm going to wait until all addresses get lat/long and try again; will report back with results. Thanks!

Upperholme commented 6 years ago

It looks like the dataset used by https://nominatim.openstreetmap.org may not be comprehensive. I've just got the same error when trying an advanced search to find contacts in proximity to the address: 17 Hanover Square, London W1S 1BN. This is a correct address according to the Post Office service at https://www.royalmail.com/find-a-postcode, but I get the message: "We could not geocode the destination address". Using the same Royal Mail service to find the postcode for 17 Hanover Square, London, it returns W1S 1HU. If I use that code then the search works as expected. I then tested the first postcode (W1S 1BN) using https://www.getthedata.com/open-postcode-geo-api and it gave me correct lat/long coordinates.

Upperholme commented 4 years ago

Not sure if this extension is fully compatible with more recent Civi releases - 5.18, 5.19 and on - but I'm finding that the custom proximity search isn't working for me, neither is the range search within Civi's Advanced Search. However the extension does seem to work fine in terms of geocoding addresses of contact records that is carried out using the scheduled job. Is it just me?

Upperholme commented 4 years ago

I've just switched a site over from Open Street Map mapping and Geocoding using this extension, to Google's services, and the proximity search is now working as I'd expect. Which suggests to me that proximity search with this extension isn't working.

bjendres commented 4 years ago

Hi @Upperholme, thanks for the reports and sorry for the late reply.

The proximity search is not provided by this extension, but by CiviCRM itself, using the geo coordinates. Therefore, if you say that it worked with Google and not with OSM that means most likely that Google was able to resolve more addresses than OSM - which sounds quite possible.

Would you be able to provide one or two of your addresses that were found in the proximity search using Google geocoding, and not found using OSM? Then would could rule out other errors...

lcdservices commented 1 year ago

FYI -- I ran into this and found that it will not geocode the destination address without a street address. We were trying to trigger a proximity searching using only a city/state/country.

From the nominatim site it does seem to support geocoding with just those values, so I'm not sure why the extension requires the street address.

bjendres commented 1 year ago

From the nominatim site it does seem to support geocoding with just those values, so I'm not sure why the extension requires the street address.

That's an interesting point, moved that to #30