====== Generating Data ======
* [[gis:ges_track_sim|GeoEvent Track Simulator]]
===== Random Date Within Range =====
Arcade:
var start_date = Date(1483246800000);
var end_date = Date(1514782799000);
var seconds = DateDiff(end_date, start_date, "seconds");
var rnd_sec = Random() * seconds;
var rnd_date = DateAdd(start_date, rnd_sec, "seconds");
return rnd_date
https://www.epochconverter.com/
===== Create Offset Time =====
Arcade:
var start_date = $feature.IncidentDate;
var diff = Round(Random() * (3600 - 28800) + 28800,0);
var newdate = DateAdd(start_date, diff, "seconds");
return newdate;
===== Calculate Difference From Date =====
var start_date
===== Sequential Numbers =====
rec=0
def autoIncrement():
global rec
pStart = 1
pInterval = 1
if (rec == 0):
rec = pStart
else:
rec += pInterval
return rec
autoIncrement()
https://support.esri.com/en/technical-article/000011137
===== Random String From List =====
import random
def list_random(ran):
return ran[random.randint(0,len(ran)-1)]
list_random(['kid', 'many', 'love', 'play'])
https://gis.stackexchange.com/questions/234687/return-random-string-from-a-list-of-strings-field-calculator-python
===== Random Int In Range =====
Arcade:
Round(Random() * (1000 - 10) + 10,0)
Python:
def randInt(rand):
return rand[random.randint(20,3000)]
===== Incremented Numbers =====
Expression:
autoIncrement()
Code Block:
rec=0
def autoIncrement():
global rec
pStart = 1 # adjust start value, if req'd
pInterval = 1 # adjust interval value, if req'd
if (rec == 0):
rec = pStart
else:
rec = rec + pInterval
return rec