def exportODRoute( route, file ):
file.write("%s;"%(route.getName().encode('utf-8')))
for section in route.getRoute():
file.write("%d;"%(section.getId().encode('utf-8')))
file.write("\n")
# Entry code, the script starts here:
outputFile = "c:/we/odroutes.txt"
file = open( outputFile, 'w' )
if file != None:
# Iterate over all odroutes in the network.
odrouteType = model.getType( "GKODRoute" )
for odroute in model.getCatalog().getObjectsByType( odrouteType ).itervalues():
exportODRoute( odroute, file )
file.close()
print "Done"