Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seed more realistic housing adresses and coordinates #1022

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

Falinor
Copy link
Collaborator

@Falinor Falinor commented Nov 26, 2024

  1. Fetch the establishment’s geojson perimeter from the relevant public French API
  2. Generate each housing with random coordinates inside the perimeter
  3. Use the French reverse geocoding (BAN) API to find the closest address to the housing coordinates
  4. Save the housing with its new correct address and coordinates

The address is supposed to be much better than a random one. It should be correct in most cases.
Also, it is guaranteed to be in the establishment’s perimeter, provided that the perimeter is correct, of course.

Limitations
The coordinates are still generated randomly. It could create issues in the test data, for instance when generated in the middle of a lake, a forest... But it’s test data, after all.

@Falinor Falinor self-assigned this Nov 26, 2024
@Falinor Falinor requested a review from loicguillois November 26, 2024 14:11
@Falinor Falinor force-pushed the test-seed-realistic-housings branch from 4c214c1 to 28e54a4 Compare November 26, 2024 17:16
@Falinor Falinor merged commit baa97bf into main Nov 26, 2024
5 of 6 checks passed
@Falinor Falinor deleted the test-seed-realistic-housings branch November 26, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants