Skip to content

Commit

Permalink
Demote GeoNames as it can be rather slow
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Aug 29, 2024
1 parent bc34e74 commit ce0f0f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,6 @@ if(((!$opts{'r'}) && (!$opts{'O'} && (!$opts{'S'}))) || $opts{'v'}) {

$geocoder->push({ regex => qr/^[\w\s]+,\s*[\w\s]+,\s*(UK|England|Wales|Scotland)$/i, geocoder => $textgeocoder });

if(my $username = $ENV{'GEONAMES_USER'}) {
$geocoder->push(Geo::GeoNames->new(username => $username));
}

# DST isn't that good for the UK
# $geocoder->push({ regex => qr/(UK|United Kingdom|England|USA|US|United States|Wales)$/i, geocoder => Geo::Coder::DataScienceToolkit->new() })`
$geocoder->push({ regex => qr/^\d.+?,.+?,\s*(USA|US|United States)$/i, geocoder => Geo::Coder::US::Census->new() })
Expand All @@ -652,6 +648,10 @@ if(((!$opts{'r'}) && (!$opts{'O'} && (!$opts{'S'}))) || $opts{'v'}) {
->push(Geo::Coder::Ovi->new());
# ->push(Geo::Coder::GeocodeFarm->new()); # Needs GT#1 to be fixed

if(my $username = $ENV{'GEONAMES_USER'}) { # Rather slow
$geocoder->push(Geo::GeoNames->new(username => $username));
}

if(my $key = $ENV{'GEO_CODER_OPENCAGE_API_KEY'}) {
$geocoder->push({ limit => 200, geocoder => Geo::Coder::OpenCage->new(api_key => $key) });
}
Expand Down

0 comments on commit ce0f0f0

Please sign in to comment.