-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathREADME.dev
65 lines (44 loc) · 1.74 KB
/
README.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
osm-read - developer guide
1) Running the tests
2) Protocol Buffers
3) Generating manyNodes.pbf test data
4) Release NPM Module
------------------------------------------------------------------------
Running the tests
Currently there is a set of mocha (https://github.com/visionmedia/mocha)
based unit and integration tests. The tests can be executed in a node.js
context and in the browser.
To run the tests within node.js type:
$ npm test
To run the tests within the browser you first have to install browserify and http-server:
$ npm install -g browserify http-server
Then run browserify in order to generate the latest osm-read-pbf.js:
$ npm run browserify
To finally execute the tests open test.html in your favourite
browser:
$ http-server -c-1 .
$ open http://127.0.0.1:8080/test.html
------------------------------------------------------------------------
Protocol Buffers
The protocol buffer definitions for reading openstreetmap pbf files have
been taken from the osmosis source code repository:
https://github.com/openstreetmap/osmosis/tree/master/osmosis-osm-binary/src/main/protobuf
js modules for the proto files generated with (see scripts in package.json):
$ npm run buildProto
------------------------------------------------------------------------
Generating manyNodes.pbf test data
The file test/manyNodes.pbf can be generated via the script
test/genManyNodes.sh. genManyNodes.sh requires bash and osmosis
installed.
------------------------------------------------------------------------
Release NPM Module
Adjust the module version in package.json. The execute the following:
$ git commit -a
$ npm install
$ npm test
$ npm run browserify
$ xdg-open test.html
$ npm publish
$ git tag <released version>
$ git push
$ git push --tags