othernodetagcursor = gp.insertcursor(nodeothertag) otherwaytagcursor = gp.insertcursor(wayothertag) nodepnt = gp.createobject("point") ftags=[] linecount = 0 blocknum = 1 if compress_temp_files: nodefile=bz2.BZ2File(scratchSpace+'/nodeblock'+str(blocknum)+'.dat','w') else: nodefile=open(scratchSpace+'/nodeblock'+str(blocknum)+'.dat','w') while True: # Read the next line from the OSM file uline = osmFile.getNextTag() if uline == '': break element = osmFile.getElement() linecount += 1 if linecount % 2000000 == 0: AddMsgAndPrint(str(nodecount) +' Vertices '+str(waycount)+' Ways ' + str(taggednodecount) +' Tagged Nodes '+str(nodetagcount)+ ' Node Tags') if element=='node': ftype = fieldType.unknown ftags = [] node = osmFile.returnNode()
nfcount = 0 wfcount = 0 rfcount = 0 cfcount = 0 nodes = 0 ways = 0 rels = 0 csets = 0 while True: # Read one XML tag without depending on line breaks # (so this works with history files) line = inputfile.getNextTag() line_count += 1 if line == '': break if line[1] == '/': element = line[1:line.find('>',1)] else: element = line[1:line.find(' ',1)] # # Node # if element == 'node':
nodepnt = gp.createobject("point") ftags = [] linecount = 0 blocknum = 1 if compress_temp_files: nodefile = bz2.BZ2File( scratchSpace + '/nodeblock' + str(blocknum) + '.dat', 'w') else: nodefile = open(scratchSpace + '/nodeblock' + str(blocknum) + '.dat', 'w') while True: # Read the next line from the OSM file uline = osmFile.getNextTag() if uline == '': break element = osmFile.getElement() linecount += 1 if linecount % 2000000 == 0: AddMsgAndPrint( str(nodecount) + ' Vertices ' + str(waycount) + ' Ways ' + str(taggednodecount) + ' Tagged Nodes ' + str(nodetagcount) + ' Node Tags') if element == 'node': ftype = fieldType.unknown