Geo::USCensus::Geocoding - The U.S. Census Bureau geocoding service
-=head1 VERSION
-
-Version 0.01
-
=cut
-our $VERSION = '0.01';
+our $VERSION = '0.02';
our $DEBUG = 0;
=head1 SYNOPSIS
=cut
my $ua = LWP::UserAgent->new;
-my $url = 'http://geocoding.geo.census.gov/geocoder/geographies/addressbatch';
+my $url = 'https://geocoding.geo.census.gov/geocoder/geographies/addressbatch';
my $csv = Text::CSV->new({eol => "\n", binary => 1});
$result->is_match(1);
$result->match_level($fields[3]);
$result->address($fields[4]);
- my ($lat, $long) = split(',', $fields[5]);
- $result->latitude($lat);
+ my ($long, $lat) = split(',', $fields[5]);
$result->longitude($long);
+ $result->latitude($lat);
$result->state($fields[8]);
$result->county($fields[9]);
$result->tract($fields[10]);
$result->block($fields[11]);
} else {
$result->is_match(0);
+ $result->match_level($fields[2]); # "No_Match", "Tie"
}
} else {
$result->error_message( $resp->status_line );
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2014 Mark Wells.
+Copyright (C) 2016 Freeside Internet Services, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published