-import os, GPS, inspect
+import os
+
+import GPS
+import StringUtils
-class RecordError(StandardError):
- pass
-class InvalidAreaError(StandardError):
+class RecordError(StandardError):
pass
class GeoRecord:
This class wraps one record in an SF1 geo file.
"""
- MinimumLineLength = 400
+ MINIMUM_LINE_LENGTH = 400
class Block:
except ValueError:
# A value couldn't be converted to the appropriate type.
continue
- except InvalidAreaError:
- # Something is funny with the geometry.
- continue
return blocks
allow the GeoRecord class to parse the data meaningfully and
throw an error if something doesn't look right.
"""
- if (len(line) < GeoRecord.MinimumLineLength):
- raise RecordError("The input line is too short. The SF1 specification requires a line length of %d characters; this line contains only %d characters" % (GeoRecord.MinimumLineLength, len(line)))
+ if (len(line) < GeoRecord.MINIMUM_LINE_LENGTH):
+ raise RecordError("The input line is too short. The SF1 specification requires a line length of %d characters; this line contains only %d characters" % (GeoRecord.MINIMUM_LINE_LENGTH, len(line)))
record = GeoRecord()