Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there an easy way of using UK Postcodes in the Google Maps function in QlikView?
The demo QVW's only appear to use lat and long but I only have post codes in my data.
Any help much appreciated.
Andrew,
As far as I know, Google map uses coordainates to show locations. That means that you need to find latitude and longitude for each UK Postcode and create a table. The chances are that such a table has been created already, and you only need to find it.
Thanks Michael. Any ideas where I can get a copy of such a table? I've been looking but not found anything so far.
Here is one link which one of the member referenced earlier. This might help you.
http://www.mapsofworld.com/lat_long/
--Arun
Hi Arun,
Did you get this working in the end? I have a demo application based on UK postcodes, and a couple of files that map postcodes onto other information - such as latitude and longitude.
Cheers,
Steve
Hi Steve, Please can you share these files with us, they would be very useful. Thanks
Hi AndrewL,
Take a look at this string :
http://community.qlik.com/thread/6832?start=0&tstart=0
and below is some code taken from a post in that string where J.J was kind enough to post an example containing below code, pulling data from the google maps API, querying it for postcodes in the UK and bringing those into a table. Below code assumes you have a field called 'PostCode', you can adjust to match your tables.
let vNbRecords = fieldvaluecount('PostCode');
for i=1 to $(vNbRecords) ;
let vPcode = FieldValue('PostCode',$(i)) ;
sleep 200 ;
Adresses:
LOAD //@1,
//@2,
@3 as latitude,
@4 as longitude,
'$(vPcode)' as 'PostCode'
FROM
[http://maps.google.com/maps/geo?q=$(vPcode)+uk&output=csv]
(txt, codepage is 1252, explicit labels, delimiter is ',', msq);
next i ;
Hi,
look at http://www.geonames.org/export/ .
There you will find from many countries, the postal code (with Lat and Long). There is a web service or you can download for each country a CSV file.