開放街圖標誌 OpenStreetMap 開放街圖

Update to the C++ Processing, template plugins

於 2009年十二月26日 由 h4ck3rm1k3English發表。

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

電子郵件圖示 藍天圖示 Facebook 圖示 LinkedIn 圖示 乳齒象圖示 Telegram 圖示 X 圖示

討論

!i!2009年12月26日 09時26分 發表的評論

Sounds good, would be cool if you put a note in the wiki :-)

登入 來留下評論