[OSM-dev] Read osmChange files with Pyosmium

G. Allegri giohappy at gmail.com
Fri Mar 17 11:33:01 UTC 2017


I've just started giving a look to Pyosmium. I've done tests based on the
examples from its repo and everything works fine.
I would like to replicate osmium changeset-filter [1] and I'm striving to
make the osmium.SimpleHandler parse the changesets from an osmChange file.

I've tried:

>>>class MyHandler(osmium.SimpleHandler):
...     def changeset(self,changeset):
...             print changeset

>>>handler = MyHandler()
>>>handler.apply_file('mychange.xml>')

but nothing happens. No errors, no outputs.

I've tried to setup the osmium.io.Reader manually, and setting the entity
bit:

>>>reader =
osmium.io.Reader('mychange.xml',osmium.osm.osm_entity_bits.CHANGESET)
>>>omsium.apply(reader,handler)

No output again.

First question: is it possible to parse osmChanges with Pyosmium? If yes,
what's the right way to do it?

Thanks a lot,
Giovanni


[1] http://osmcode.org/osmium-tool/manual.html#working-with-changesets
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20170317/f3012632/attachment.html>


More information about the dev mailing list