[OSM-dev] osmjs -- before_* and after_* are not called?

Jochen Topf jochen at remote.org
Mon Aug 29 08:10:47 BST 2011


On Sun, Aug 28, 2011 at 09:58:08PM -0600, Martijn van Exel wrote:
> I am using osmjs to do some statistical analysis on a large number of
> osm data files. I'm noticing that the before_* and after_* callbacks

Those callbacks are not exposed to the Javascript side, they are only available
from C++ code. The reason is the support for multipolygons in osmjs by reading
the file twice. Its unclear when those callbacks should "fire".

You can work around this by remembering in global variables whether the other
callbacks were called and do some things when they are called for the first
time.

I realize this is not optimal (and probably not documented). I am unhappy
with the way Javascript callbacks are done anyway, but don't know yet how
best to fix that, so it will probabyl not change anytime soon.

> are not performed. I am using Peter's fork of osmium, should not make
> a huge difference?

Thats doesn't make a difference in this case.

> BTW, is it already possible to use osmium for full history files? I'm
> not even concerned about doing stuff with geometries, only gathering
> staistics -- ie what have users contributed over time.

Yes, thats possible.

Jochen
-- 
Jochen Topf  jochen at remote.org  http://www.remote.org/jochen/  +49-721-388298




More information about the dev mailing list