From 63f2205c95de0992570d3f83ad07786c0102c3ce Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 12 Sep 2009 18:37:45 -0400 Subject: [PATCH] Fixed the Block class initialization so that it converts intptlat/intptlon to real coordinates. --- src/SummaryFile1.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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): -- 2.44.2