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

get_random_realistic_address returns the same address for each zip #7

Open
bmos opened this issue Dec 13, 2023 · 1 comment
Open

get_random_realistic_address returns the same address for each zip #7

bmos opened this issue Dec 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bmos
Copy link
Contributor

bmos commented Dec 13, 2023

To reproduce:
python3 -m generate_fake_list --real-address-zips "04101"

The issue is that

geocoder.forward("04101", country=["us"])

returns a single result:

{
  'type': 'FeatureCollection',
  'query': ['04101'],
  'features': [
    {
      'id': 'postcode.9441004',
      'type': 'Feature',
      'place_type': ['postcode'],
      'relevance': 1,
      'properties': {'mapbox_id': 'dXJuOm1ieHBsYzprQTdz'},
      'text': '04101',
      'place_name': 'Portland, Maine 04101, United States',
      'bbox': [-70.284472, 43.6427499, -70.1815676, 43.675744],
      'center': [-70.25486, 43.661028],
      'geometry': {
        'type': 'Point',
        'coordinates': [-70.25486, 43.661028]
      },
      'context': [
        {'id': 'place.265562348', 'mapbox_id': 'dXJuOm1ieHBsYzpEOVFvN0E', 'wikidata': 'Q49201', 'text': 'Portland'},
        {'id': 'district.5670636', 'mapbox_id': 'dXJuOm1ieHBsYzpWb2Jz', 'wikidata': 'Q497788', 'text': 'Cumberland County'},
        {'id': 'region.337132', 'mapbox_id': 'dXJuOm1ieHBsYzpCU1Rz', 'wikidata': 'Q724', 'short_code': 'US-ME', 'text': 'Maine'},
        {'id': 'country.8940', 'mapbox_id': 'dXJuOm1ieHBsYzpJdXc', 'wikidata': 'Q30', 'short_code': 'us', 'text': 'United States'}
      ]
    }
  ]
}
@bmos bmos added the bug Something isn't working label Dec 13, 2023
@bmos
Copy link
Contributor Author

bmos commented Dec 13, 2023

so far, I have not found any good way to select random real addresses for a zip code.

The only possible solution seems to be using a fixed dataset like https://openaddresses.io/.
But this still will not work very well in covering some areas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant