from objects import Node, NodeTag class OSM: def __init__(self, _osmContent): self.osmContent = str(_osmContent) self.nodeList = [] self.nodeTagList = [] self.parseOsmContent() def parseOsmContent(self): lines = self.osmContent.split("\n") nodeLines = [] for line in lines: if "" in line: try: self.createNode([line]) except: print("Node could not be inserted") else: nodeLines.append(line) elif "" in line: try: self.createNode(nodeLines) except: print("Node could not be inserted") nodeLines = [] elif len(nodeLines) > 0: nodeLines.append(line) def createNode(self, lines): nodeId = "" for line in lines: if "