Package Exports
- osmium
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (osmium) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-osmium
Flexible Javascript library for working with OpenStreetMap data.
Provides bindings to the libosmium C++ library.
Should you use node-osmium?
If you want top performance use libosmium directly in C++. These node-osmium
bindings, due to the expense of passing objects from C++ to Javascript, are
much slower than working in C++ directly. Consider node-osmium only for small
extracts and prototyping. For large extracts or planet processing we recommend
leveraging the libosmium C++ API
instead of using node-osmium.
Is node-osmium actively developed?
@springmeyer and @joto are maintaining node-osmium but not actively adding features. We will consider pull requests adding features only when they come with very solid tests, add very clear value to the bindings, and seem easy to maintain.
Depends
- Node.js v0.10.x, v4.x, or v5.x (v4 and v5 supported only with node-osmium >= 0.5.x)
- libosmium (http://osmcode.org/libosmium, https://github.com/osmcode/libosmium)
- protozero (https://github.com/mapbox/protozero) (The protozero headers are included in the libosmium repository, so if you used libosmium from git, protozero is already available.)
- Mocha (http://visionmedia.github.io/mocha/, for tests)
Installing
By default, binaries are provided and no external dependencies or compile is needed.
Just do:
npm install osmiumWe currently provide binaries for 64 bit OS X and 64 bit Linux. Running npm install on other platforms will fall back to a source compile (see
Developing below for build details).
Usage
See the tutorial for an introduction. There are some demo
applications in the 'demo' directory. See the README.md
there. You can also have a look at the tests in the test directory.
Developing
If you wish to develop on node-osmium you can check out the code and then
build like:
git clone https://github.com/osmcode/node-osmium.git
cd node-osmium
makeUse make debug to build with debug information. Use make coverage to build
with code coverage.
Use make VERBOSE=1 to output compiler calls used etc.
Testing
npm install mocha
make testSource build dependencies
- Compiler that supports
-std=c++11(>= clang++ 3.4 || >= g++ 4.8) - libosmium
- Boost >= 1.46 with development headers
- zlib
See also the dependency information for the Osmium library.
Set dependencies up on Ubuntu Precise (12.04) like:
sudo apt-add-repository --yes ppa:chris-lea/node.js
sudo apt-add-repository --yes ppa:ubuntu-toolchain-r/test
sudo apt-get -y update
sudo apt-get -y install git gcc-4.8 g++-4.8 build-essential nodejs
sudo apt-get -y install libboost-dev zlib1g-dev libexpat1-dev libsparsehash-dev
export CC=gcc-4.8
export CXX=g++-4.8
git clone https://github.com/scrosby/OSM-binary.git
cd OSM-binary/src
make && sudo make installSet dependencies up on OS X like:
git clone https://github.com/mapnik/mapnik-packaging.git
cd mapnik-packaging/osx
export CXX11=true
source MacOSX.sh
./scripts/build_bzip2.sh
./scripts/build_expat.sh
./scripts/build_google_sparsetable.sh
./scripts/build_boost.sh --with-test --with-program_options
./scripts/build_protobuf.sh
./scripts/build_osm-pbf.sh
# NOTE: in the same terminal then run the build commands
# Or from a different terminal re-run `source MacOSX.sh`License
node-osmium is available under the Boost Software License. See LICENSE.txt for details.
Contact
Please open bug reports on https://github.com/osmcode/node-osmium/issues. You can ask questions on the OSM developer mailing list or on OFTC net IRC channel #osm-dev.
Authors
- Dane Springmeyer (dane@mapbox.com)
- Jochen Topf (jochen@topf.org)


