Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
agni_gold
Specialist III
Specialist III

Extract latitude and Longitude using QV Script

I am trying to extract lat and lon from google map using following script.

address:

LOAD A as Address

FROM

(ooxml, no labels, table is Sheet1);

let noRows = NoOfRows('address')-1;

for i=0 to $(noRows)

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

Data:

LOAD

'$(a)' as Address,

[result/geometry/location/lng] AS longitude,

[result/geometry/location/lat] AS latitude

FROM [http://maps.googleapis.com/maps/api/geocode/xml?address=$(a)&sensor=false];

drop Table address;

but when i load this script then an error comes [result/geometry/location/lng] not found .

but when i check http://maps.googleapis.com/maps/api/geocode/xml?address=Delhi&sensor=false

this link in internet file it will show same path as i used .

Please help.

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Check this script, I am getting the values.  May be check whether the proxy is blocking any request.  In some companies they will block, you check in machine which has full internet access without any blocking.

GeocodeResponse:

LOAD status,  

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

    [result/geometry/location/lng] as [location/lng],

    %Key_GeocodeResponse_62C7A0A69859D655    // Key for this table: GeocodeResponse

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

Regards,

Jagan.

View solution in original post

2 Replies
afurtado
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi.  See

http://community.qlik.com/message/433531#433531

Alessandro Furtado

furtado@farolbi.com.br
jagan
Partner - Champion III
Partner - Champion III

Hi,

Check this script, I am getting the values.  May be check whether the proxy is blocking any request.  In some companies they will block, you check in machine which has full internet access without any blocking.

GeocodeResponse:

LOAD status,  

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

    [result/geometry/location/lng] as [location/lng],

    %Key_GeocodeResponse_62C7A0A69859D655    // Key for this table: GeocodeResponse

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

Regards,

Jagan.