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

feat: only consider cities from the most likely country #606

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

MartinKolarik
Copy link
Member

Sometimes, we run into a case where we get multiple cities that are different but close to each other, and then one somewhere far, reported by two providers, e.g.:

lisbon, PT
san francisco, US
san jose, US
new york, US
lisbon, PT
johannesburg, ZA
amsterdam, NL
lelystad, NL (almost amsterdam)
amsterdam, NL
johannesburg, ZA

Sometimes each provider returns a different city, but multiple agree on the country:

calais, FR
Paris, FR
brugge, BE
roubaix, FR

We currently don't consider at all how close or far the cities are, and doing so makes sense and does improve the results a little. I initially considered clustering the cities by distance based on coordinates, but this is easier and seems to work just as well.

@MartinKolarik MartinKolarik merged commit 2e76b83 into master Jan 21, 2025
4 of 5 checks passed
@MartinKolarik MartinKolarik deleted the geoip-country branch January 21, 2025 12:34
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