Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
silviacico
Partner - Contributor II
Partner - 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
swuehl
MVP
MVP

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.

View solution in original post

5 Replies
silviacico
Partner - Contributor II
Partner - Contributor II
Author

No suggestions?

eduardo_dimperio
Specialist II
Specialist II

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

swuehl
MVP
MVP

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
Partner - Contributor II
Partner - Contributor II
Author

Thank you

silviacico
Partner - Contributor II
Partner - Contributor II
Author

Thank you, I'll definitely try.