Skip to content
Commits on Source (4)
.mason
mason
mason_packages
.*.swp
.DS_Store
berlin-latest.osm.pbf
......@@ -7,3 +10,4 @@ includes.log
iwyu.log
lib/binding
node_modules
.ycm_extra_conf.pyc
......@@ -8,3 +8,10 @@ demo
node_modules
scripts
test
mason_packages
.mason
.ycm_extra_conf.py
appveyor.yml
build-local-test.bat
bootstrap.sh
lib/binding
#-----------------------------------------------------------------------------
#
# Configuration for continuous integration service at travis-ci.org
#
#-----------------------------------------------------------------------------
language: cpp
os:
- linux
- osx
sudo: false
compiler:
- clang
git:
depth: 2
# don't re-build for tags so that [publish binary] is not re-run
# https://github.com/travis-ci/travis-ci/issues/1532
branches:
except:
- /^v[0-9]/
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- pkg-config
- make
- libstdc++-4.8-dev
cache:
directories:
- $HOME/.ccache
env:
matrix:
# static_build == portable, statically linked node-osmium and deps
# shared_build == non-portable, shared libraries via package manager
- NODE_NVM_VERSION="0.10" RUN_BUILD="static_build"
- NODE_NVM_VERSION="0.10" RUN_BUILD="shared_build"
include:
# Linux
- os: linux
compiler: clang
env: NODE_VERSION="4"
- os: linux
compiler: clang
env: NODE_VERSION="6"
- os: linux
compiler: clang
env: NODE_VERSION="8"
- os: linux
compiler: clang
env: NODE_VERSION="10"
# OS X
- os: osx
osx_image: xcode8
compiler: clang
env: NODE_VERSION="4"
- os: osx
osx_image: xcode8
compiler: clang
env: NODE_VERSION="6"
- os: osx
osx_image: xcode8
compiler: clang
env: NODE_VERSION="8"
- os: osx
osx_image: xcode8
compiler: clang
env: NODE_VERSION="10"
env:
global:
- secure: Ac0sNxaMmm/4NLJwjB5W74wNNrXH2cFz4qADJSJwGr+p78NVrp+3B70Nlffg6sf6sq57KeoQi5EbUNSa4fjLS2FqJJDr5U8cOA4nt5tPGm8cucdAyr4VCREEddtV4jfIcNN0/I/DKIK4d744SmpqomVYqTUFOVK8LOT4vAX3tTo=
- secure: bsD0VyN6F6+ratG/C2AB1GrbmaPGyvaAgjZXd7tsQPYl+TR3BT643T9GikgN5IJdbjVBOJDfSqk76g/UlfLl9bRnoybP8tJsZJhCyMYKyRNGJZBIOyEVe6j5FrcT5ejBO0EIGaw2fXwSkG92pg7CFQOAPkVNgcl/H0XNdMa3Q/8=
- JOBS: 8
- CLANG_VERSION: "5.0.1"
before_install:
# check if tag exists and matches package.json
# workaround travis rvm bug
# https://github.com/travis-ci/travis-ci/issues/6307
# http://superuser.com/questions/1044130/why-am-i-having-how-can-i-fix-this-error-shell-session-update-command-not-f
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
rvm get head || true
fi
- scripts/validate_tag.sh
# get commit message
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
# put node-pre-gyp on path
- export PATH=./node_modules/.bin/:$PATH
# here we set up the node version on the fly based on the matrix value.
# This is done manually so that it is easy to flip the 'language' to
# objective-c in another branch (to run the same travis.yml on OS X)
- git clone https://github.com/creationix/nvm.git ../.nvm
- source ../.nvm/nvm.sh
- nvm install $NODE_NVM_VERSION
- nvm use $NODE_NVM_VERSION
- node --version
- npm --version
- if [[ $(uname -s) == 'Darwin' ]]; then brew uninstall --force node; fi;
- source ./scripts/install_node.sh ${NODE_VERSION}
install:
# set a few env settings for the static build script
- NODE_MODULE_ROOT=$(pwd)
- TMP_DEPS_DIR=$(mktemp -d -t XXXXXXXXXXX)
# WARNING: this script modifies the environment
- source ./scripts/${RUN_BUILD}.sh
- cd ${NODE_MODULE_ROOT}
- source ./bootstrap.sh
- if [[ $(uname -s) == 'Linux' ]]; then
./mason/mason install clang++ ${CLANG_VERSION};
export PATH=$(./mason/mason prefix clang++ ${CLANG_VERSION})/bin:${PATH};
export CXX="ccache clang++ -Qunused-arguments";
export CC="ccache clang -Qunused-arguments";
$CXX --version
export PYTHONPATH=$(pwd)/mason_packages/.link/lib/python2.7/site-packages;
else
export PYTHONPATH=$(pwd)/mason_packages/.link/lib/python/site-packages;
fi;
- git clone --depth=1 --branch=$(node -e "console.log(require('./package.json').libosmium_version)") https://github.com/osmcode/libosmium.git ../libosmium
- git clone --depth=1 --branch=$(node -e "console.log(require('./package.json').protozero_version)") https://github.com/mapbox/protozero.git ../protozero
before_script:
# install from source, ensure this works first
- git clone https://github.com/osmcode/libosmium.git ../libosmium
- npm install --build-from-source --clang=1
- if [[ `uname -s` == 'Darwin' ]]; then otool -L ./lib/binding/* || true; fi
- if [[ `uname -s` == 'Linux' ]]; then readelf -d ./lib/binding/* || true; fi
- if [[ ${COVERAGE} == true ]]; then
PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user cpp-coveralls;
make coverage;
else
make;
fi;
- nm lib/binding/osmium.node | grep "GLIBCXX_3.4.2[0-9]" || true
- npm test
- node-pre-gyp package
- node-pre-gyp testpackage
- ./scripts/coverage.sh
script:
# now we publish the binary, if needed
- PUBLISH_BINARY=false
# or check if we are manually requesting binary publishing via a commit keyword
- if [[ $RUN_BUILD == "static_build" ]] && test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi;
# if either are true, then publish the binary
# Note: this publishing is done here, in the 'script' section, instead of the 'after_success'
# since we want any failure here to stop the build immediately
- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp publish; fi
# now clean up to prepare to re-install from remote binary
- node-pre-gyp clean
# now install from published binary
# Note: we capture the error here so that if the install fails we can unpublish
- INSTALL_RESULT=0
- if [[ $PUBLISH_BINARY == true ]]; then INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true; fi
# if install returned non zero (errored) then we first unpublish and then call false so travis will bail at this line
- if [[ $INSTALL_RESULT != 0 ]]; then echo "returned $INSTALL_RESULT";node-pre-gyp unpublish;false; fi
# If success then we arrive here so let's test again
- if [[ $PUBLISH_BINARY == true ]]; then npm test; fi
- ./scripts/publish.sh
#-----------------------------------------------------------------------------
#
# Configuration for YouCompleteMe Vim plugin
#
# http://valloric.github.io/YouCompleteMe/
#
#-----------------------------------------------------------------------------
from os.path import realpath, dirname
basedir = dirname(realpath(__file__))
# some default flags
# for more information install clang-3.2-doc package and
# check UsersManual.html
flags = [
'-Werror',
'-Wall',
'-Wextra',
'-pedantic',
'-Wno-return-type',
'-Wno-unused-parameter',
'-Wno-unused-variable',
'-std=c++11',
# '-x' and 'c++' also required
# use 'c' for C projects
'-x',
'c++',
# include dirs
'-I%s/src' % basedir,
'-I%s/../libosmium/include' % basedir,
'-I/usr/include/nodejs/src',
]
# youcompleteme is calling this function to get flags
# You can also set database for flags. Check: JSONCompilationDatabase.html in
# clang-3.2-doc package
def FlagsForFile( filename ):
return {
'flags': flags,
'do_cache': True
}
## Changelog
### 0.1.2
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [unreleased] -
### Added
### Changed
### Fixed
## [0.5.7] - 2018-07-01
### Added
- Now supporting node v10
### Changed
- Upgraded to libosmium v2.14.0.
- Upgraded to nan v2.10.0
- Upgraded to node-pre-gyp v0.10.1
- Upgraded to boost 1.66.0
- Upgraded to expat 2.2.4
- Upgraded to clang++ 5.0.1
## [0.5.6] - 2017-08-09
### Changed
- Upgraded to libosmium v2.12.2.
- Upgraded to nan v2.6.2
- Upgraded to node-pre-gyp v0.6.36
- Upgraded to boost 1.63.0
- Upgraded to expat 2.2.0
- Now compiling with clang++ 4.0.1
- No longer providing binaries for node v5
## [0.5.5] - 2017-08-09
### Changed
- Now building binaries against libstdc++-4.8-dev (which avoids a dependency on >= GLIBCXX 3.4.20)
- Should work on >= ubuntu trusty and amazon linux without needing to upgrade libstdc++
- Added node v8 binaries
## [0.5.4] - 2016-11-21
### Changed
- Using newest libosmium, version 2.10.3.
## [0.5.3] - 2016-09-19
### Changed
- Using newest libosmium, version 2.9.0.
## [0.5.2] - 2016-07-28
### Fixed
- Now properly statically linking bz2 on linux (no longer accidentally depends
on shared libbz2)
- Fixed memory leak in handler which regressed in 0.5.0.
(https://github.com/osmcode/node-osmium/issues/79)
### Added
- Add area support to `object_to_entity_bits()` function.
(https://github.com/osmcode/node-osmium/pull/49)
## [0.5.1] - 2016-07-21
### Added
- Support for node v6.
### Changed
- Updated to libosmium 2.7.2
- Upgraded node-pre-gyp to 0.5.10
## [0.5.0] - 2016-03-31
### Added
- Support for node v4 and v5 (now ported to use Nan@2.2.1)
### Changed
- Updated to libosmium 2.6.1
## [0.4.5] - 2016-02-10
### Changed
- Updated to libosmium 2.6.0
### Fixed
- Fixed abort when invalid data is based to an `osmium.Buffer`
## [0.4.4] - 2015-11-10
### Fixed
- Removes bindings from npm bundle to fix installation via node-pre-gyp
## [0.4.3] - 2015-11-10
### Added
- GeoJSON support for Areas
- Lots of tests for Areas
### Fixed
- Issue with buffer not being flushed which resulted in some Areas
not showing up in the handler.
## [0.4.2] - 2015-09-01
### Changed
- Updated to libosmium 2.4.1
## [0.4.1] - unreleased due to version number confusion
## [0.4.0] - 2015-08-19
### Added
- Added `osmium.Stream`
- Added `osmium.FlexReader`
- Added `osmium.Filter`
### Changed
- Renamed `osmium.Reader` to `osmium.BasicReader`
- Updated to libosmium@33d479d7eada041
- Ported build system to [mason](https://github.com/mapbox/mason)
- Upgraded node-pre-gyp to 0.6.6
- Preliminary support for running on windows
## [0.1.2] - 2014-04-29
### Changed
- Upgraded node-pre-gyp to 0.5.10
[unreleased]: https://github.com/osmcode/libosmium/compare/v0.5.4...HEAD
[0.5.4]: https://github.com/osmcode/libosmium/compare/v0.5.3...v0.5.4
[0.5.3]: https://github.com/osmcode/libosmium/compare/v0.5.2...v0.5.3
[0.5.2]: https://github.com/osmcode/libosmium/compare/v0.5.1...v0.5.2
[0.5.1]: https://github.com/osmcode/libosmium/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/osmcode/libosmium/compare/v0.4.5...v0.5.0
[0.4.5]: https://github.com/osmcode/libosmium/compare/v0.4.4...v0.4.5
[0.4.4]: https://github.com/osmcode/libosmium/compare/v0.4.3...v0.4.4
[0.4.3]: https://github.com/osmcode/libosmium/compare/v0.4.2...v0.4.3
[0.4.2]: https://github.com/osmcode/libosmium/compare/v0.4.0...v0.4.2
[0.4.0]: https://github.com/osmcode/libosmium/compare/v0.1.2...v0.4.0
......@@ -8,23 +8,42 @@ INCLUDES_REPORT_FILES := $(subst src,check_reports,$(INCLUDE_FILES:.hpp=.compile
DEMOS := $(shell find demo -mindepth 1 -maxdepth 1 -type d)
all: build
.PHONY: all build
ifeq ($(VERBOSE),1)
LOGLEVEL := verbose
else
LOGLEVEL := error
endif
./node_modules:
npm install --build-from-source
all: build-all
.PHONY: all build-all
build: ./node_modules
./node_modules/.bin/node-pre-gyp build --loglevel=silent
./node_modules/node-pre-gyp:
npm install node-pre-gyp
debug:
./node_modules/.bin/node-pre-gyp rebuild --debug
./node_modules: ./node_modules/node-pre-gyp
npm install `node -e "console.log(Object.keys(require('./package.json').dependencies).join(' '))"` \
`node -e "console.log(Object.keys(require('./package.json').devDependencies).join(' '))"` --clang=1
verbose:
./node_modules/.bin/node-pre-gyp rebuild --loglevel=verbose
./build:
./node_modules/.bin/node-pre-gyp configure --loglevel=$(LOGLEVEL) --clang=1
build-all: ./node_modules ./build
./node_modules/.bin/node-pre-gyp build --loglevel=$(LOGLEVEL) --clang=1
debug: ./node_modules ./build
./node_modules/.bin/node-pre-gyp build --loglevel=$(LOGLEVEL) --debug --clang=1
coverage: ./node_modules
export LDFLAGS="--coverage" && export CXXFLAGS="--coverage" && ./node_modules/.bin/node-pre-gyp rebuild --loglevel=$(LOGLEVEL) --debug --clang=1
testpack:
rm -f ./*tgz
npm pack
tar -ztvf *tgz
rm -f ./*tgz
clean:
rm -rf ./build ./check_reports lib/binding
rm -rf ./build ./check_reports lib/binding ./node_modules/
rm -f includes.log iwyu.log
rm -rf lib/binding/
......@@ -35,7 +54,7 @@ rebuild:
@make clean
@make
test: build
test:
@PATH="./node_modules/mocha/bin:${PATH}" && NODE_PATH="./lib:$(NODE_PATH)" mocha -R spec --timeout 10s
indent:
......
# node-osmium
Fast and flexible Javascript library for working with OpenStreetMap data.
Flexible Javascript library for working with OpenStreetMap data.
Provides bindings to the [libosmium](https://github.com/osmcode/libosmium)
C++ library.
[![NPM](https://nodei.co/npm/osmium.png?downloads=true&downloadRank=true)](https://nodei.co/npm/osmium/)
[![Build Status](https://secure.travis-ci.org/osmcode/node-osmium.png)](http://travis-ci.org/osmcode/node-osmium)
[![Coverage Status](https://coveralls.io/repos/osmcode/node-osmium/badge.svg?branch=coverage)](https://coveralls.io/r/osmcode/node-osmium?branch=coverage)
[![Dependencies](https://david-dm.org/osmcode/node-osmium.png)](https://david-dm.org/osmcode/node-osmium)
## 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](https://github.com/osmcode/libosmium)
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
- libosmium (https://github.com/osmcode/libosmium)
- Mocha (http://visionmedia.github.io/mocha/, for tests)
- Node.js v4.x, v6.x, v8.x
- Mocha (http://mochajs.org/, for tests)
- Compiler that supports `-std=c++11` (>= clang++ 3.6 || >= g++ 4.8)
- [libosmium](https://github.com/osmcode/libosmium) >= 2.10.3
(Debian/Ubuntu: libosmium2-dev)
- [protozero](https://github.com/mapbox/protozero) >= 1.5.1
(Debian/Ubuntu: libprotozero-dev)
- [Utfcpp](http://utfcpp.sourceforge.net/)
This is included in the libosmium repository and might or might not
have been installed with it. See the libosmium README.
(Debian/Ubuntu: libutfcpp-dev)
- [Boost](http://www.boost.org/) >= 1.55 with development headers
(Debian/Ubuntu: libboost-dev)
- [zlib](http://www.zlib.net/)
(Debian/Ubuntu: zlib1g-dev)
- [expat](http://expat.sourceforge.net/)
Debian/Ubuntu: libexpat1-dev
If you have problems compiling, install the dependencies for libosmium first
and make sure it works. Then you should be able to get node-osmium to compile.
## Installing
......@@ -22,7 +60,9 @@ needed.
Just do:
```shell
npm install osmium
```
We 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
......@@ -41,60 +81,30 @@ there. You can also have a look at the tests in the `test` directory.
If you wish to develop on `node-osmium` you can check out the code and then
build like:
```shell
git clone https://github.com/osmcode/node-osmium.git
cd node-osmium
make
```
Use `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 test
### Source build dependencies
- Compiler that supports `-std=c++11` (>= clang++ 3.2 || >= g++ 4.8)
- Boost >= 1.46 with development headers
- OSM-Binary
- Protocol buffers
- 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 protobuf-compiler
sudo apt-get -y install libprotobuf-lite7 libprotobuf-dev libexpat1-dev
sudo apt-get -y install 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 install
Set 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
......@@ -102,6 +112,7 @@ can ask questions on the
[OSM developer mailing list](https://lists.openstreetmap.org/listinfo/dev)
or on [OFTC net IRC channel #osm-dev](https://wiki.openstreetmap.org/wiki/Irc).
## Authors
- Dane Springmeyer (dane@mapbox.com)
......
......@@ -11,6 +11,7 @@
"src/apply.cpp",
"src/buffer_wrap.cpp",
"src/file_wrap.cpp",
"src/filter.cpp",
"src/handler.cpp",
"src/location_handler_wrap.cpp",
"src/multipolygon_collector_wrap.cpp",
......@@ -23,16 +24,49 @@
"src/osm_object_wrap.cpp",
"src/osm_relation_wrap.cpp",
"src/osm_way_wrap.cpp",
"src/reader_wrap.cpp",
"src/basic_reader_wrap.cpp",
"src/flex_reader_wrap.cpp",
"src/utils.cpp"
],
"include_dirs": [
"../protozero/include/",
"../libosmium/include/",
"./src/"
"./src/",
"<!(node -e \"require('nan')\")"
],
"defines": [
"_LARGEFILE_SOURCE",
"_FILE_OFFSET_BITS=64"
"_FILE_OFFSET_BITS=64",
"OSMIUM_WITH_SPARSEHASH"
],
"conditions" : [
["OS=='win'",
{
'include_dirs':[
'<!(echo %LODEPSDIR%)/boost',
'<!(echo %LODEPSDIR%)/sparsehash/include',
'<!(echo %LODEPSDIR%)/bzip2/include',
'<!(echo %LODEPSDIR%)/zlib/include',
'<!(echo %LODEPSDIR%)/expat/include',
'<!(echo %LODEPSDIR%)/protozero/include',
],
"libraries": [
"Ws2_32.lib",
"<!(echo %LODEPSDIR%)/expat/lib/libexpat.lib",
"<!(echo %LODEPSDIR%)/zlib/lib/zlibwapi.lib",
"<!(echo %LODEPSDIR%)/bzip2/lib/libbz2.lib"
],
"defines": [
"NOMINMAX"
]
},{
"libraries": [
"-lexpat",
"-lz",
"-lbz2"
]
}
]
],
"xcode_settings": {
"GCC_ENABLE_CPP_RTTI": "YES",
......@@ -44,13 +78,6 @@
},
"cflags_cc!": ["-fno-rtti", "-fno-exceptions"],
"cflags_cc" : ["-std=c++11", "-Wno-return-type"],
"libraries": [
"-losmpbf",
"-lprotobuf-lite",
"-lexpat",
"-lz",
"-lbz2"
]
},
{
"target_name": "action_after_build",
......
#!/bin/bash
set -eu
set -o pipefail
function dep() {
./mason/mason install $1 $2
./mason/mason link $1 $2
}
# default to clang
CXX=${CXX:-clang++}
function all_deps() {
dep boost 1.66.0
dep expat 2.2.4
dep bzip2 1.0.6
dep zlib system
dep sparsehash 2.0.2
}
MASON_VERSION="v0.18.0"
function setup_mason() {
mkdir -p ./mason
curl -sSfL https://github.com/mapbox/mason/archive/${MASON_VERSION}.tar.gz | tar --gunzip --extract --strip-components=1 --exclude="*md" --exclude="test*" --directory=./mason
export PATH=$(pwd)/mason:$PATH
export MASON_HOME=$(pwd)/mason_packages/.link
export CXX=${CXX:-clang++}
export CC=${CC:-clang}
}
function main() {
setup_mason
all_deps
export C_INCLUDE_PATH="${MASON_HOME}/include"
export CPLUS_INCLUDE_PATH="${MASON_HOME}/include"
export CXXFLAGS="-I${MASON_HOME}/include"
export LIBRARY_PATH="${MASON_HOME}/lib"
export LDFLAGS="-L${MASON_HOME}/lib"
echo "success: now run 'npm install --build-from-source'"
}
main
set +eu
set +o pipefail
@echo off
CLS
SETLOCAL
SET EL=0
cl
IF %ERRORLEVEL% EQU 9009 SET EL=%ERRORLEVEL% && ECHO start from VS command prompt && GOTO ERROR
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO CL found
ddt
IF %ERRORLEVEL% EQU 9009 SET EL=%ERRORLEVEL% && ECHO ddt not available && GOTO ERROR
ECHO DDT found
IF "%1"=="" ( ECHO no deps path && exit /b 1)
ddt /Q build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET LODEPSDIR=%1
SET PROJ_LIB=%LODEPSDIR%\proj\share
set GDAL_DATA=%LODEPSDIR%\gdal\data
SET PATH=%LODEPSDIR%\geos\lib;%PATH%
SET PATH=%LODEPSDIR%\gdal\lib;%PATH%
SET PATH=%LODEPSDIR%\expat\lib;%PATH%
SET PATH=%LODEPSDIR%\libtiff\lib;%PATH%
SET PATH=%LODEPSDIR%\zlib\lib;%PATH%
::SET PATH=%LODEPSDIR%\osmpbf\lib%PATH%
::SET INCLUDE=%LODEPSDIR%;%INCLUDE%
node -v
node -e "console.log(process.arch,process.execPath)"
npm install --build-from-source --msvs_version=2013 --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
GOTO DONE
:ERROR
SET EL=%ERRORLEVEL%
ECHO.
ECHO ====================== ERROR %EL% ======================
ECHO.
:DONE
ECHO ===== DONE ======
EXIT /b %EL%
{
'target_defaults': {
'default_configuration': 'Release',
'msbuild_toolset':'v140',
'configurations': {
'Debug': {
'cflags_cc!': ['-O3', '-Os', '-DNDEBUG'],
......@@ -17,9 +18,17 @@
'DEAD_CODE_STRIPPING': 'YES',
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES'
},
'ldflags': [
'-Wl,-s'
]
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': 1, # /EHsc
'RuntimeTypeInfo': 'true', # /GR
'RuntimeLibrary': '2', # /MD
"AdditionalOptions": [
"/MP", # compile across multiple CPUs
"/wd4068", # suppress unrecognized pragma warnings
],
}
}
}
}
}
......
node-osmium (0.3.0-1) UNRELEASED; urgency=medium
node-osmium (0.5.7-1) UNRELEASED; urgency=medium
* Initial release (Closes: #779927)
-- Bas Couwenberg <sebastic@debian.org> Fri, 06 Mar 2015 15:16:48 +0100
-- Bas Couwenberg <sebastic@debian.org> Mon, 11 Feb 2019 16:30:30 +0100
......@@ -14,3 +14,6 @@ upstream-tag = upstream/%(version)s
# Always use pristine-tar.
pristine-tar = True
[buildpackage]
pbuilder-options = --source-only-changes
......@@ -10,4 +10,3 @@ Then run the `index.js` for usage help:
./index.js
......@@ -4,7 +4,8 @@ Convert OSM file into spatialite database.
## Install
npm install
Install npm module `spatialite` somewhere, where
the osmium module can find it.
## Usage
......
/*
XXXXXXXXXXXXXXXXXXX
This code doesn't work currently.
XXXXXXXXXXXXXXXXXXX
*/
#!/usr/bin/env node
var osmium = require('../../');
......
......@@ -36,7 +36,7 @@ handler.on('done', function() {
stream.close();
});
var reader = new osmium.Reader(input_filename);
var reader = new osmium.BasicReader(input_filename);
var location_handler = new osmium.LocationHandler();
osmium.apply(reader, location_handler, handler);
reader.close();
......
......@@ -23,7 +23,7 @@ function stop(msg) {
if (!argv.output || typeof(argv.output) != 'string') stop('--output argument required (path to a new file or the keyword "stdout")');
if (!argv.input || typeof(argv.input) != 'string') stop('--input argument required (path to an osm file)');
var reader = new osmium.Reader(argv.input);
var reader = new osmium.BasicReader(argv.input);
var geojsonOut = geojsonStream.stringify();
......
......@@ -3,10 +3,6 @@
Reads OSM history file and outputs the number of highways at the beginning of
each year.
## Install
npm install
## Usage
./index.js OSMFILE
......
......@@ -21,7 +21,7 @@ handler.on('way', function(way) {
});
console.log("Reading input file into memory...\n");
var reader = new osmium.Reader(input_filename);
var reader = new osmium.BasicReader(input_filename);
var buffer = reader.read_all();
reader.close();
......