Skip to content

Commit

Permalink
Wichambreaux was missing
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Sep 28, 2018
1 parent 340b191 commit c1c7216
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions createdatabase.PL
Original file line number Diff line number Diff line change
Expand Up @@ -988,9 +988,12 @@ if(my $oa = $ENV{'OPENADDR_HOME'}) {
next if(!$properties->{'mz:is_current'});
next if($properties->{'wof:country'} ne uc($country));
my $street = $properties->{'addr:street'};
next if(!defined($street));
# next if(!defined($street));
# https://github.com/whosonfirst-data/whosonfirst-data/issues/1193
$street =~ s/;.+$//;
if($street) {
$street =~ s/;.+$//;
$street = uc($street);
}
my $city = $properties->{'sg:city'};
# Don't trust sg:city to be correct
my @hierarchy = @{$properties->{'wof:hierarchy'}};
Expand Down Expand Up @@ -1030,7 +1033,7 @@ if(my $oa = $ENV{'OPENADDR_HOME'}) {
'LON' => $properties->{'geom:longitude'},
'NAME' => uc($properties->{'wof:name'}),
'NUMBER' => uc($properties->{'addr:housenumber'}),
'STREET' => uc($street),
'STREET' => $street,
'CITY' => $city,
'STATE' => $state,
'COUNTRY' => $country,
Expand Down Expand Up @@ -1718,6 +1721,7 @@ sub city_key {
return "$city,$county,$state,$country";
}

# Given a Whosonfirst ID, return the matching geojson. Cache lookups
sub get_wof {
my ($dbh, $id) = @_;

Expand Down
4 changes: 4 additions & 0 deletions t/whosonfirst.t
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ WHOSONFIRST: {
delta_within($location->{latitude}, 51.34, 1e-2);
delta_within($location->{longitude}, 1.40, 1e-2);
# diag(Data::Dumper->new([$location])->Dump());

# $location = $geocoder->geocode('Wickhambreaux, Kent, England');
# ok(defined($location));
# ok(ref($location) eq 'HASH');
} else {
diag('Author tests not required for installation');
skip('Author tests not required for installation', 40);
Expand Down

0 comments on commit c1c7216

Please sign in to comment.