Created
March 2, 2025 20:27
-
-
Save joeywhelan/f831239ee9a881c48f21a09562357da0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def worker(ndocs): | |
| global fake | |
| result = [] | |
| for _ in range(ndocs): | |
| uuid = str(uuid4()) | |
| coords = fake.local_latlng(country_code="US", coords_only=True) | |
| lat = round(float(coords[0]) + random.uniform(-1, 1), 5) # faker local_latlng generates duplicates. this is a workaround | |
| lng = round(float(coords[1]) + random.uniform(-1, 1), 5) | |
| point_lnglat = f'{lng} {lat}' | |
| point_wkt = Point(lng, lat).wkt | |
| dob = fake.date_of_birth(minimum_age=10, maximum_age=90).year | |
| result.append({"uuid": uuid, "point_lnglat": point_lnglat, "point_wkt": point_wkt, "dob": dob}) | |
| return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment