Skip to content

Commit

Permalink
Remove the population field if it's empty
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jan 21, 2025
1 parent 835f564 commit 39f1529
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Geo/Coder/Free.pm
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ my %common_words = (
'at' => 1,
'be' => 1,
'by' => 1,
'how' => 1,
'she' => 1,
'of' => 1,
'for' => 1,
Expand Down
1 change: 1 addition & 0 deletions lib/Geo/Coder/Free/MaxMind.pm
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ sub geocode {
if(defined($city) && defined($city->{'Latitude'})) {
# Cache and return result
delete $city->{'Region'} if(defined($city->{'Region'}) && ($city->{'Region'} =~ /^[A-Z]\d$/)); # E.g. Region = G5
delete $city->{'Population'} if(defined($city->{'Population'}) && (length($city->{'Population'}) == 0));
my $rc = Geo::Location::Point->new({
%{$city},
('database' => 'MaxMind', 'confidence' => $confidence)
Expand Down

0 comments on commit 39f1529

Please sign in to comment.