Skip to content

Instantly share code, notes, and snippets.

@randybondsjr
Last active May 16, 2022 20:31
Show Gist options
  • Save randybondsjr/e4c74e91dd33c6f55bc6a719d9d220ca to your computer and use it in GitHub Desktop.
Save randybondsjr/e4c74e91dd33c6f55bc6a719d9d220ca to your computer and use it in GitHub Desktop.
def obfuscateAddress(address):
# Make the address less specific than the service is providing
addrArr = address.split(" ")
cleanAddress = ''
if addrArr[0].isnumeric and "&" not in address:
numZeros = len(addrArr[0]) - 1;
houseNum = addrArr[0][0:-2] + "00";
outAddr = houseNum + " BLK of";
iterAddr = iter(addrArr)
next(iterAddr) # skip the real house number
for token in iterAddr:
outAddr += " " + token;
cleanAddress = outAddr;
else:
cleanAddress = address;
addressComments = cleanAddress.split(";");
addressComments = addressComments[0].split("#");
cleanAddress = addressComments[0];
return cleanAddress;
def obfuscatePoint(in_x,in_y):
# move the point to a slightly different location within about 200 ft
min = -60 # Meters
max = 60
#min = -200 # Feet
#max = 200
rand_x = random.randint(min,max)
rand_y = random.randint(min,max)
#rand_x = random.uniform(-0.000547, 0.000547) # decimal degrees in Yakima if using decimal degrees
#rand_y = random.uniform(-0.000375, 0.000375) # x and y have different measures for 200 ft
x = in_x + rand_x
y = in_y + rand_y
return x,y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment