gramener / geocode-excel

Convert addresses to lat-longs (and vice versa) in Excel
48 stars 22 forks source link

Nominatim Geocoding gets errors when running the function #6

Closed lcoulon closed 2 years ago

lcoulon commented 3 years ago

Hello,

I use Excel 2019 Professionnal 64 bits, when i try to use Nominatim functions : nominatimgeocode and NominatimReverseGeocode , the returned result is an error message : " Echec du téléchargement de la ressource spécifiée"

Would you please tell me how to fix that issue ?

Thanks,

sanand0 commented 3 years ago

This looks like an Excel reference library version issue. Let me see if I can spot where this happens...

Walfou commented 2 years ago

Hello,

I use Excel 2019 Professionnal 64 bits, when i try to use Nominatim functions : nominatimgeocode and NominatimReverseGeocode , the returned result is an error message : " Echec du téléchargement de la ressource spécifiée"

Would you please tell me how to fix that issue ?

Thanks,

@lcoulon I had the same issue on an Excel with european regional parameters, i.e. that uses a comma as decimal separator, which is not compatible with the API format (latitudes and longitudes should be with a point as decimal symbol) I solved the issue by replacing xDoc.Load ("https://nominatim.openstreetmap.org/reverse?lat=" + CStr(lat) + "&lon=" + CStr(lng)) by xDoc.Load ("https://nominatim.openstreetmap.org/reverse?lat=" + Replace(CStr(lat), ",", ".") + "&lon=" + Replace(CStr(lng), ",", "."))

sanand0 commented 2 years ago

@Walfou -- thanks for this. The issue completely stumped me. I believe replacing CStr with Str will suffice, since Str() uses English conventions, while CStr() is locale aware. I'll put in a fix.