For some reason, this code does not print any nodes, ways, or relations, even though it clearly does download the minute updates from OpenStreetMap:
import logging
import osmium
from osmium.replication.server import ReplicationServer
logging.basicConfig(level=logging.DEBUG)
class Handler(osmium.SimpleHandler):
def __init__(self):
super(Handler, self).__init__()
def node(self, n):
print('n', n.id)
def way(self, w):
print('w', w.id)
def relation(self, r):
print('r', r.id)
h = Handler()
rs = ReplicationServer('http://planet.openstreetmap.org/replication/minute')
rs.apply_diffs(h, 2112110, 0.4*1024)
Result:
$ python3 osm2rdf.py
DEBUG:pyosmium:Downloaded change 2112110. (86 kB available in download buffer)
DEBUG:pyosmium:Downloaded change 2112111. (36 kB available in download buffer)
DEBUG:pyosmium:Downloaded change 2112112. (4 kB available in download buffer)
DEBUG:pyosmium:Downloaded change 2112113. (-139 kB available in download buffer)
Process finished with exit code 0
Note that there hasn't been a single 'n', 'w', or 'r' printed after change downloading.
Turns out it was a bug in the pyosmium itself. Closing.