I have made an update to the sax processing of the OSM.
Now you have a nice way to plug in your own processing ,at high speed without any funny overhead!
The OSM processor is a template function that
has four template parameters :
http://bazaar.launchpad.net/~jamesmikedupont/%2Bjunk/EPANatReg/annotate/head%3A/OSMProcessor.hpp
Each of those parameters are passed to a similar template SAX callback processor
http://bazaar.launchpad.net/~jamesmikedupont/%2Bjunk/EPANatReg/annotate/head%3A/SAX2OsmHandlers.hpp
It creates a world object, and each type of processor, passing the world to them by reference so they can access it. Then it parses the xml and calls the user defined templates on call back.
each one gets the chance to handle the StartElement callback from sax and do what they want. You dont have to do anything and that makes it fast.
So, now you can just define your own plugins as you like. If you want to have two plugins, you can define a new class that combines two of them. It should be very simple to make incremental and standalone processors for OSM data that are very fast.
Now that this framework is started, I invite you all to help out.
Mike
Discussion
Comment from !i! on 26 December 2009 at 09:26
Sounds good, would be cool if you put a note in the wiki :-)