summaryrefslogtreecommitdiff
path: root/Geocoding/Match.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-09-11 15:54:45 -0700
committerMark Wells <mark@freeside.biz>2014-09-11 15:54:45 -0700
commit792fa56fe32dfea38ab824183dc130bc926480df (patch)
tree671231a28c33964531bb5f829b6d30f22b5fcd74 /Geocoding/Match.pm
Import original source of Geo-USCensus-Geocoding 0.01
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;