From: Michael Orlitzky Date: Sat, 12 Sep 2009 22:37:45 +0000 (-0400) Subject: Fixed the Block class initialization so that it converts intptlat/intptlon to real... X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fcensus-tools.git;a=commitdiff_plain;h=63f2205c95de0992570d3f83ad07786c0102c3ce Fixed the Block class initialization so that it converts intptlat/intptlon to real coordinates. --- diff --git a/src/SummaryFile1.py b/src/SummaryFile1.py index bfc6258..d646b07 100644 --- a/src/SummaryFile1.py +++ b/src/SummaryFile1.py @@ -45,9 +45,19 @@ class Block: self.arealand = float(geo_record.arealand) self.areawatr = float(geo_record.areawatr) + # Both latitude and longitude are given to six digits of + # precision (i.e. after the decimal point). But, there are no + # decimal points in the intptlon/intptlat fields, so we need + # to add them. + # + # By default, the coordinates will be parsed as integers. For + # example, +12345678 will be parsed as 12345678.0. So, we need + # to "move" that decimal point 6 places to the left. We know + # how to do that. + # self.coordinates = GPS.Coordinates() - self.coordinates.latitude = float(geo_record.intptlat) - self.coordinates.longitude = float(geo_record.intptlon) + self.coordinates.latitude = (float(geo_record.intptlat) / (10**6)) + self.coordinates.longitude = (float(geo_record.intptlon) / (10**6)) def tiger_blkidfp00(self):