Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am having an issue with this script that I found in the shared QVWs that looks up coordinates for "City State Zip" addresses. I was hoping someone could shed some light on the subject because it seems to return incorrect coordinates for some not all of the addresses. I cross verified some of the locations that were incorrect by putting their URLs in the browser and the browser returns the correct longitude and latitude.
Here is the script:
let vCounter = fieldvaluecount('CityState');
for i=1 to $(vCounter) ;
let vExcelFieldValue = FieldValue('CityState',$(i));
set ErrorMode = 0;
sleep 100 ; // server timeout Google
Adresses:
ADD LOAD
$(i) as num,
@1,
@2,
@3 as latitude,
@4 as longitude,
now() as Quand,
'$(vExcelFieldValue)' as CityState,
1 as Top
FROM
[http://maps.google.com/maps/geo?q=$(vExcelFieldValue)&gl=us&output=csv&ie=utf-8&sensor=false&key=$(gmap_key)]
(txt, codepage is 1252, explicit labels, delimiter is ',', msq);
next i ;
Please Help!
Thanks
Marc
Hey Martin,
Thanks for the reply. I think I figured it out. I think it might have been a slow internet connection. I changed the sleep from 100 to 150 and it seemed to do the trick. Could be a coincidence but all is working now.
Thanks again.
Marc
Hi,
Remove the line "set ErrorMode = 0;" and describe your error.
This line ignore the failure and continue script execution.
Martin
Hey Martin,
Thanks for the reply. I think I figured it out. I think it might have been a slow internet connection. I changed the sleep from 100 to 150 and it seemed to do the trick. Could be a coincidence but all is working now.
Thanks again.
Marc