Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
No suggestions?
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
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.
Thank you
Thank you, I'll definitely try.