Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem to get information from Google map for non-English text

In the script below I manage to get the information (longitude  and latitude) for the English text

But the information is not returned for the non-English.

If I take the URL into the browser:

http://maps.google.com/maps/geo?q=Бахчисарай&output=xml&oe=utf8&sensor=false&key=XXYYZZ

I’m getting the information in the XML

Any ideas?

Thanks in advance.

This is my script:

SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

Table1:
LOAD * Inline [
id,  region,
1,   Mumbai,
2,   Аромат,
3,   Bakhchisaray
]
;


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

for i=0 to $(noRows)

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

     let address=peek('region',$(i),'Table1');


Data:
LOAD
'$(a)'
as id,
'$(address)'
as regionname,
subfield([Response/Placemark/Point/coordinates], ',' ,1) AS longitude,
subfield([Response/Placemark/Point/coordinates], ',' ,2) AS latitude
FROM [http://maps.google.com/maps/geo?q=$(address)&output=xml&oe=utf8&sensor=false&key=XXYYZZ] (XmlSimple, Table is [kml]);

next


// Google Maps Key
// get a key here http://code.google.com/apis/maps/signup.html
gmap_key = XXYYZZ ';
max_zoom_level = 17; //maximum value 17

// Variables required for calculating map
// No need to change these
var_pi180=      '=pi()/180';
var_lat_offset= '0';
var_mc2=        '=256*pow(2,$(var_zoom))';
var_mc1=        '=256*pow(2,($(var_zoom)-1))';
var_mid_lat=    '=min(latitude)+(1+var_lat_offset)*((max(latitude)-min(latitude))/2)';
var_mid_long=   '=min(longitude)+(max(longitude)-min(longitude))/2';
var_zoom=       '=max(aggr(if(max( round(256*pow(2,(_zoom_level -1)))+( longitude *((256*pow(2,_zoom_level ))/360)) )-min( round(256*pow(2,(_zoom_level -1)))+( longitude *((256*pow(2,_zoom_level ))/360)) ) <map_size_x AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<map_size_y,_zoom_level,1),_zoom_level))';
var_maptype=    '=if(isnull(only(maptype)),fieldvalue( '&chr(39)&'maptype'&chr(39)&', 1 ),maptype)';
map_size_x= '400';
map_size_y=     '400';

SET HidePrefix='_' ;
// Field required for calcualting best zoom level
_zoom_level:
Load RecNo( ) as _zoom_level autogenerate(max_zoom_level);

maptype:
LOAD * INLINE [
maptype
roadmap
mobile
satellite
terrain
hybrid
]
;

0 Replies