Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I would like some assistance in adding google maps into my Qlikview project.
I have used the following example to no success: https://community.qlik.com/docs/DOC-3136#start=75
I have also left a comment on the same but no one has replied.
Will really appreciate some insight.
Regards
George
go through Google Map Static (For INDIA)
Vikas
Hi,
See the attachment.
Thanks,
AS
Thanks Vikas....not from India but hope the group moderator will add me
Thanks Amit,
the information is helpful, though i do not have already created data with longitudes and latitudes.
So basically am using a list of Cities and Countries that have no latitude/longitudes, Therefore i need to use these cities to generate the codes.
I have over 500,000 records with a column for City and Country. To generate the location codes it takes forever and finally it does not work. This is when i perform a "Reload"
This is the Piece of code i have. It only loads coordinates for 514000 - 513000=1000 records
ProviderTable:
LOAD
[Claimed Amount] AS ClaimAmount,
[Claim Provider Name] AS ClaimProviderName,
[Claims Provider City] AS ClaimsProviderCity,
[Claims Provider Region] AS ClaimsProviderRegion,
[Claims Provider Country] AS ClaimsProviderCountry,
%ClaimIDKey as ClaimKey
Resident CLAIMS_FACT;
let noRows = NoOfRows('ProviderTable')-513000; //ONLY 1000 records instead of 514000, it freezes when i do not restrict
for i=0 to $(noRows)
let a = peek('ClaimProviderName',$(i),'ProviderTable');
let b = peek('ClaimsProviderCity',$(i),'ProviderTable');
let c = peek('ClaimAmount',$(i),'ProviderTable');
let d = peek('ClaimsProviderRegion',$(i),'ProviderTable');
let e = peek('ClaimsProviderCountry',$(i),'ProviderTable');
let f = peek('ClaimKey',$(i),'ProviderTable');
GeocodeResponse:
LOAD
status,
'$(a)' as ProviderName,
'$(b)' as ProviderCity,
'$(c)' as ProviderAmount,
'$(d)' as ProviderRegion,
'$(e)' as ProviderCountry,
'$(f)' as [%ClaimIDKey],
([result/geometry/location/lat]) as latitude,
([result/geometry/location/lng]) as longitude
FROM [http://maps.googleapis.com/maps/api/geocode/xml?address=$(b)&sensor=false] (XmlSimple, Table is [GeocodeResponse]);
next i;
// Google Maps Key
gmap_key = '';
max_zoom_level = 14;
def_zoom_level = 7;
def_map_size = 400;
// Variables required for calculating map
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 = '=median(latitude)';
var_mid_long = '=median(longitude)';
var_zoom = '=if(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)))<def_map_size 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()))))<def_map_size,_zoom_level,null()),_zoom_level))>def_zoom_level,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)))<def_map_size 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()))))<def_map_size,_zoom_level,null()),_zoom_level)),def_zoom_level)';
var_maptype = '=if(isnull(only(maptype)),fieldvalue('&chr(39)&'maptype'&chr(39)&',4),maptype)';
// Calculate best zoom level
set HidePrefix = '_';
_zoom_level:
LOAD RecNo() as _zoom_level AutoGenerate(max_zoom_level);
maptype:
LOAD * INLINE [
Maptype
roadmap
mobile
satellite
terrain
hybrid
];
Thanks
George