reads in a node and returns as a tuple: (type, name, points[])

def readObject(self, innode):
        '''reads in a node and returns as a tuple: (type, name, points[])'''
        #get name
        names=innode.getElementsByTagName('name')[0].childNodes[0].data.strip()
        
        #get type
        pointType = 'Unknown'
        if len(innode.getElementsByTagName('LineString')) == 0 and len(innode.getElementsByTagName('Point')) == 0:
            pointType = 'Polygon'
        elif len(innode.getElementsByTagName('Polygon')) == 0 and len(innode.getElementsByTagName('Point')) == 0:
            pointType = 'Polygon'
        elif len(innode.getElementsByTagName('LineString')) == 0 and len(innode.getElementsByTagName('Polygon')) == 0:
            pointType = 'Point'
            
        #get coords
        coords = innode.getElementsByTagName('coordinates')[0].childNodes[0].data.strip()
        coordsSplit = coords.split()
        ret_s = []
        for j in coordsSplit:
            jcoord = j.split(',')
            if len(jcoord) == 3 and jcoord[0] != '' and jcoord[1] != '':
                #print("Got lon " + jcoord[0] + " and lat " + jcoord[1])
                ret_s.append((float(jcoord[1]), float(jcoord[0])))
            
        #return tuple
        return (str(pointType), str(names), ret_s)