diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-10-18 00:30:43 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-10-18 00:30:43 -0700 |
commit | 519f2393ecc06f548c76a677490add1adb1c1edf (patch) | |
tree | 85675f10e7d851b2466d3efb9f34f2699e7c8a92 | |
parent | de8af19ba927b41c29d905dba4bb5c1e7f2e2863 (diff) |
ezlocate is gone
-rw-r--r-- | FS/FS/Conf.pm | 17 | ||||
-rw-r--r-- | FS/FS/Misc/Geo.pm | 81 |
2 files changed, 1 insertions, 97 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 940303f..e410586 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4330,7 +4330,6 @@ and customer address. Include units.', 'type' => 'select', 'select_hash' => [ '' => '', 'usps' => 'U.S. Postal Service', - 'ezlocate' => 'EZLocate', 'tomtom' => 'TomTom', 'melissa' => 'Melissa WebSmart', ], @@ -4353,25 +4352,11 @@ and customer address. Include units.', { 'key' => 'tomtom-userid', 'section' => 'UI', - 'description' => 'TomTom geocoding service API key. See <a href="http://www.tomtom.com/">the TomTom website</a> to obtain a key. This is recommended for addresses in the United States only.', + 'description' => 'TomTom geocoding service API key. See <a href="http://geocoder.tomtom.com/">the TomTom website</a> to obtain a key. This is recommended for addresses in the United States only.', 'type' => 'text', }, { - 'key' => 'ezlocate-userid', - 'section' => 'UI', - 'description' => 'User ID for EZ-Locate service. See <a href="http://www.geocode.com/">the TomTom website</a> for access and pricing information.', - 'type' => 'text', - }, - - { - 'key' => 'ezlocate-password', - 'section' => 'UI', - 'description' => 'Password for EZ-Locate service.', - 'type' => 'text' - }, - - { 'key' => 'melissa-userid', 'section' => 'UI', # it's really not... 'description' => 'User ID for Melissa WebSmart service. See <a href="http://www.melissadata.com/">the Melissa website</a> for access and pricing.', diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm index 1af4991..e41ba5d 100644 --- a/FS/FS/Misc/Geo.pm +++ b/FS/FS/Misc/Geo.pm @@ -333,87 +333,6 @@ sub standardize_usps { addr_clean=> 'Y' } } -my %ezlocate_error = ( # USA_Geo_002 documentation - 10 => 'State not found', - 11 => 'City not found', - 12 => 'Invalid street address', - 14 => 'Street name not found', - 15 => 'Address range does not exist', - 16 => 'Ambiguous address', - 17 => 'Intersection not found', #unused? -); - -sub standardize_ezlocate { - my $self = shift; - my $location = shift; - my $class; - #if ( $location->{country} eq 'US' ) { - # $class = 'USA_Geo_004Tool'; - #} - #elsif ( $location->{country} eq 'CA' ) { - # $class = 'CAN_Geo_001Tool'; - #} - #else { # shouldn't be a fatal error, just pass through unverified address - # warn "standardize_teleatlas: address lookup in '".$location->{country}. - # "' not available\n"; - # return $location; - #} - #my $path = $conf->config('teleatlas-path') || ''; - #local @INC = (@INC, $path); - #eval "use $class;"; - #if ( $@ ) { - # die "Loading $class failed:\n$@". - # "\nMake sure the TeleAtlas Perl SDK is installed correctly.\n"; - #} - - $class = 'Geo::EZLocate'; # use our own library - eval "use $class 0.02"; #Geo::EZLocate 0.02 for error handling - die $@ if $@; - - my $userid = $conf->config('ezlocate-userid') - or die "no ezlocate-userid configured\n"; - my $password = $conf->config('ezlocate-password') - or die "no ezlocate-password configured\n"; - - my $tool = $class->new($userid, $password); - my $match = $tool->findAddress( - $location->{address1}, - $location->{city}, - $location->{state}, - $location->{zip}, #12345-6789 format is allowed - ); - warn "ezlocate returned match:\n".Dumper($match) if $DEBUG > 1; - # error handling - B codes indicate success - die $ezlocate_error{$match->{MAT_STAT}}."\n" - unless $match->{MAT_STAT} =~ /^B\d$/; - - my %result = ( - address1 => $match->{MAT_ADDR}, - address2 => $location->{address2}, - city => $match->{MAT_CITY}, - state => $match->{MAT_ST}, - country => $location->{country}, - zip => $match->{MAT_ZIP}, - latitude => $match->{MAT_LAT}, - longitude => $match->{MAT_LON}, - censustract => $match->{FIPS_ST}.$match->{FIPS_CTY}. - sprintf('%07.2f',$match->{CEN_TRCT}), - addr_clean => 'Y', - ); - if ( $match->{STD_ADDR} ) { - # then they have a postal standardized address for us - %result = ( %result, - address1 => $match->{STD_ADDR}, - address2 => $location->{address2}, - city => $match->{STD_CITY}, - state => $match->{STD_ST}, - zip => $match->{STD_ZIP}.'-'.$match->{STD_P4}, - ); - } - - \%result; -} - sub _tomtom_query { # helper method for the below my %args = @_; my $result = Geo::TomTom::Geocoding->query(%args); |