Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Google GeoCoding not working anymore

In order to get the logitude and latitude data form Google I have used the below mentioned scripting.

But this is not working anymore.

Does anyone has an idea?

Table1:

LOAD

           Address,

           Patient,

     Population,

     City    

FROM testgoogle.xlsx

(ooxml, embedded labels, table is Blad1);

let noRows = NoOfRows('Table1');

for i=0 to $(noRows)

          let c=peek('City',$(i),'Table1');

          let p=peek('Population',$(i),'Table1');

          let a=peek('Address',$(i),'Table1');

        Data:

          LOAD

          '$(c)' as City,

          '$(p)' as Population,

          '$(a)' as Address,

          subfield([Response/Placemark/Point/coordinates], ',' ,1) AS Longitude,

          subfield([Response/Placemark/Point/coordinates], ',' ,2) AS Latitude

          FROM [http://maps.google.com/maps/geo?q=$(a)&output=xml&oe=utf8&sensor=false&key=XXYYZZ] (XmlSimple, Table is [kml]);

Tags (1)
5 Replies
laujerry
Contributor

Re: Google GeoCoding not working anymore

i have the same problem too

but did u replace the key [XXYYZZ] with your own?

laujerry
Contributor

Re: Google GeoCoding not working anymore

Not applicable

Re: Google GeoCoding not working anymore

Hi

what have you changed? it it still not working for me

laujerry
Contributor

Re: Google GeoCoding not working anymore

From: http://community.qlik.com/docs/DOC-3136#/?page=2

[result/geometry/location/lat] as latitude,

[result/geometry/location/lng] as longitude

FROM [http://maps.googleapis.com/maps/api/geocode/xml?address=$(address)&sensor=false] (XmlSimple, Table is [GeocodeResponse]);

if u access the link through a broswer, like
http://maps.googleapis.com/maps/api/geocode/xml?address=new+york&sensor=false

u can see how the response values are retrieved

u can fetch the value "status" for your reference too

https://developers.google.com/maps/documentation/geocoding/#StatusCodes

laujerry
Contributor

Re: Google GeoCoding not working anymore

but i also find that this method does not support characters other than english

if my address is in chinese, the status shows "invalid request" but i can get the OK status when accessing the same link with a broswer

now i have to encode my address source data before passing to qlikview to solve the problem