Qlik Community

Qlik Sense Deployment & Management

Discussion board where members learn more about Qlik Sense Installation, Deployment and Management.

silviacico
New Contributor II

Auto generate geographical data

Hi all,

I need to generate random geographical data of Italy (lat and long) for each UserID in a Qlik Sense app. So I need to "generate" such information in a field for each distinct UserID.

Can somebody suggest how is it possible to do such thing?

Many thanks in advance,

Silvia

1 Solution

Accepted Solutions
MVP
MVP

Re: Auto generate geographical data

Maybe start with generating a random postal code for each UserID:

Codice di avviamento postale - Wikipedia

Then use e.g. Google Maps API to find latitude and longitude using the postal codes / adresses.

Google Maps API - Get Coordinates of address - Stack Overflow

Alternatively, you can also create randomly generated coordinates for e.g. an enclosing square of Italy, then maybe eliminate all coordinates in sea (which is probably the hard part). Maybe all coordinates that can't be translated to an address by the Google API.

5 Replies
silviacico
New Contributor II

Re: Auto generate geographical data

No suggestions?

eduardo_dimperi
Valued Contributor II

Re: Auto generate geographical data

Ciao Silvia,

You can use this function Rand() and check for some boundlines of Italy like  46°,6° ; 37°,15° and after that check on Google API if that belongs or not to Italy. Not Easy, but can be done.


PS: Studing the coordinances of your country i think you can check all points above 37° and below 46° (north, south) and above 6° and below 15° (east, west). But the careful because there so many points and google will charges for more then a certain number of consults per day

MVP
MVP

Re: Auto generate geographical data

Maybe start with generating a random postal code for each UserID:

Codice di avviamento postale - Wikipedia

Then use e.g. Google Maps API to find latitude and longitude using the postal codes / adresses.

Google Maps API - Get Coordinates of address - Stack Overflow

Alternatively, you can also create randomly generated coordinates for e.g. an enclosing square of Italy, then maybe eliminate all coordinates in sea (which is probably the hard part). Maybe all coordinates that can't be translated to an address by the Google API.

silviacico
New Contributor II

Re: Auto generate geographical data

Thank you

silviacico
New Contributor II

Re: Auto generate geographical data

Thank you, I'll definitely try.

Community Browser