# Intilializes/Creates the database with all tables and table contents
import sqlite3
def createNode(conn, lines):
nodeId = ""
cur = conn.cursor()
for line in lines:
if "" in line:
try:
createNode(conn, [line])
except:
print("Node could not be inserted")
else:
nodeLines.append(line)
elif "" in line:
print("CREATE")
try:
createNode(conn, nodeLines)
except:
print("Node could not be inserted")
nodeLines = []
elif len(nodeLines) > 0:
print("Append")
nodeLines.append(line)
elif "" in line:
try:
createWay(conn, wayLines)
except:
print("Way could not be inserted")
wayLines = []
elif len(wayLines) > 0:
wayLines.append(line)
conn.commit()
conn.close()
print("Done: Initializing database")