tyrasd/osmtogeojson — pull request #28 by nrenner (2014-07-25 10:55:42+00:00)
Title: OSM PBF support using osm-read

Not an actual pull request yet, would like to discuss first (CLI, tests and readme docs are missing).

This is an attempt at integrating the OSM PBF parser of [osm-read](https://github.com/marook/osm-read).
See example [block #cdb6e84562a9c183a310](http://bl.ocks.org/nrenner/cdb6e84562a9c183a310) ([Gist](https://gist.github.com/nrenner/cdb6e84562a9c183a310)).

There are some drawbacks though:

* usage is different because of async API with callback
added an optional pbfCallback parameter (see [example](https://gist.github.com/nrenner/cdb6e84562a9c183a310#file-index-html-L26)):
````
osmtogeojson(pbf, null, function(err, geojson) { ... });
````
* for Node.js, osm-read only supports passing a file path parameter, not the data itself (as Buffer)
I haven't added detecting a path parameter yet, so the [Node.js example](https://gist.github.com/nrenner/cdb6e84562a9c183a310#file-index-js) calls the parser itself
* larger package file size because of osm-read dependencies (108 kB vs. 24 kB)
added a separate distributable ``pbftogeojson.js``

Because of these, I'm not sure if it makes sense to integrate or rather have a separate project (e.g. "pbftogeojson") that builds on osmtogeojson. It sure would be nice to have all in one place, but I fear it might be too complicated/confusing? What do you think?