diff --git a/createdatabase.PL b/createdatabase.PL index 8170a22..e481258 100755 --- a/createdatabase.PL +++ b/createdatabase.PL @@ -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'}}; @@ -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, @@ -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) = @_; diff --git a/t/whosonfirst.t b/t/whosonfirst.t index 7f5846a..1305622 100644 --- a/t/whosonfirst.t +++ b/t/whosonfirst.t @@ -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);