import UTM_Lineseg as ul class Road(ul.UTM_Lineseg): # Road inherits from UTM_Lineseg def __init__(self, n, p0, p1): # initialize the Road class member variable 'name' self.name = n # name is a class member variable of the Road class ul.UTM_Lineseg.__init__(self, p0, p1) # construct the underlying UTM_Lineseg object def report(self): TAB = '\t' TAB2 = TAB + TAB nameField = 'name: ' + TAB + self.name p0CoordField = TAB2 + 'p0: easting: ' + str(self.p0.easting) + ', northing: ' + str(self.p0.northing) p0UTMField = TAB2 + 'p0: UTM zone: ' + str(self.p0.zone) + self.p0.hemisphere p1CoordField = TAB2 + 'p1: easting: ' + str(self.p1.easting) + ', northing: ' + str(self.p1.northing) p1UTMField = TAB2 + 'p1: UTM zone: ' + str(self.p1.zone) + self.p1.hemisphere lengthField = TAB2 + 'length: ' + str(self.length()) + ' meters' print nameField print p0CoordField print p0UTMField print p1CoordField print p1UTMField print lengthField