Ejemplo n.º 1
0
                    break

        # Relation
        elif inputfile.objType == objTypes.relation:
            if not resolve:
                continue

            relation_list.add(inputfile.objID)
            changeset_list.add(inputfile.objChangeset)
            node_list.update(relation_nodes)
            way_list.update(relation_ways)

    # while True:

    if show_stats:
        print 'Bytes read from OSM file: ' + str(inputfile.getBytesRead())
        print 'Objects processed: ' + str(obj_count)

        print "Changeset list count: " + str(len(changeset_list))
        print "Node list count: " + str(len(node_list))
        print "Way list count: " + str(len(way_list))
        print "Relation list count: " + str(len(relation_list))

    del inputfile

except Exception, ErrorDesc:
    print "Step 1 Failed : " + str(ErrorDesc)
    print "Line " + str(inputfile.line_count) + ":" + inputfile.getTag()
    print "Bytes read: " + str(inputfile.getBytesRead())
    finish = time.clock()
    print "Extract incomplete in " + str(finish - start) + " seconds."
Ejemplo n.º 2
0
                trow.SetValue("Way_ID",long(way[0]))
                
                for f in standardFields:
                    trow.setValue(f, '')
                    
                for sTag in ftags:
                    trow.setValue(sTag[0], str(sTag[1].encode('utf-8')))
                    
                waytagcursor.insertrow(trow)
            hasvalidtags=False
        
        # if element==...
               
    AddMsgAndPrint( str(nodecount) +' Vertices   ' +str(taggednodecount)+'  Nodes    '+str(waycount)+' Ways')

    AddMsgAndPrint( 'Bytes read from OSM file: ' + str(osmFile.getBytesRead()))

    #Close files that were written to.
    nodefile.close() 
    #unbuiltsegments.close()
    unbuiltways.close()   

    del osmFile

    # Clean up GP objects
    del nodepnt
    del waytagcursor
    del othernodetagcursor
    del otherwaytagcursor
    del nodecursor
Ejemplo n.º 3
0
            
    
        # Relation
        elif inputfile.objType == objTypes.relation:
            if not resolve:
                continue
    
            relation_list.add(inputfile.objID)
            changeset_list.add(inputfile.objChangeset)
            node_list.update(relation_nodes)
            way_list.update(relation_ways)
    
    # while True:
    
    if show_stats:    
        print 'Bytes read from OSM file: ' + str(inputfile.getBytesRead())
        print 'Objects processed: ' + str(obj_count)
    
        print "Changeset list count: " + str(len(changeset_list))
        print "Node list count: " + str(len(node_list))
        print "Way list count: " + str(len(way_list))
        print "Relation list count: " + str(len(relation_list))
    
    del inputfile

except Exception, ErrorDesc:
    print "Step 1 Failed : " + str(ErrorDesc)
    print "Line " + str(inputfile.line_count) + ":" + inputfile.getTag()
    print "Bytes read: " + str(inputfile.getBytesRead())
    finish = time.clock()
    print "Extract incomplete in " + str(finish - start) + " seconds."
Ejemplo n.º 4
0
                for f in standardFields:
                    trow.setValue(f, '')

                for sTag in ftags:
                    trow.setValue(sTag[0], str(sTag[1].encode('utf-8')))

                waytagcursor.insertrow(trow)
            hasvalidtags = False

        # if element==...

    AddMsgAndPrint(
        str(nodecount) + ' Vertices   ' + str(taggednodecount) +
        '  Nodes    ' + str(waycount) + ' Ways')

    AddMsgAndPrint('Bytes read from OSM file: ' + str(osmFile.getBytesRead()))

    #Close files that were written to.
    nodefile.close()
    #unbuiltsegments.close()
    unbuiltways.close()

    del osmFile

    # Clean up GP objects
    del nodepnt
    del waytagcursor
    del othernodetagcursor
    del otherwaytagcursor
    del nodecursor