summaryrefslogtreecommitdiff
path: root/Geocoding/Match.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Geocoding/Match.pm')
-rw-r--r--Geocoding/Match.pm43
1 files changed, 43 insertions, 0 deletions
diff --git a/Geocoding/Match.pm b/Geocoding/Match.pm
new file mode 100644
index 0000000..6584203
--- /dev/null
+++ b/Geocoding/Match.pm
@@ -0,0 +1,43 @@
+package Geo::USCensus::Geocoding::Match;
+
+use strict;
+
+sub new {
+ my $class = shift;
+ my $address = shift;
+ my $census = shift;
+
+ my $self = { %$address };
+ bless $self, $class;
+}
+
+sub matchedAddress {
+ my $self = shift;
+ $self->{matchedAddress};
+}
+
+sub coordinates {
+ my $self = shift;
+ $self->{coordinates};
+}
+
+sub addressComponents {
+ my $self = shift;
+ $self->{addressComponents};
+}
+
+sub geographies {
+ my $self = shift;
+ $self->{geographies};
+}
+
+sub censustract {
+ my $self = shift;
+ return '' unless $self->geographies
+ and exists($self->geographies->{'Census Tracts'})
+ and exists($self->geographies->{'Census Tracts'}->[0]);
+ my $ct = $self->geographies->{'Census Tracts'}->[0];
+ return $ct->{STATE} . $ct->{COUNTY} . $ct->{TRACT};
+}
+
+1;