Ejemplo n.º 1
0
    # 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."
    sys.exit(-2)

line_count = 0

try:
    # Input is maybe a very big file
    inputfile = OSMReader(inFile)

    # OSM XML Header stuff - made up as usual
    print '<?xml version="1.0" encoding="UTF-8"?>'
    # "2011-02-16T01:11:04Z"  "%Y-%m-%dT%H:%M:%SZ"
    timestamp = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
Ejemplo n.º 2
0
    # 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."
    sys.exit(-2)

line_count = 0

try:
    # Input is maybe a very big file
    inputfile = OSMReader(inFile)
    
    # OSM XML Header stuff - made up as usual
    print '<?xml version="1.0" encoding="UTF-8"?>'
    # "2011-02-16T01:11:04Z"  "%Y-%m-%dT%H:%M:%SZ"
    timestamp = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())