1.0.1 • Published 3 months ago

jov2 v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
3 months ago

jOV2

NPM version GitHub last commit Github workflow Test coverage License

jOV2 is a light Javascript API for extracting POI (Point Of Interest) from an OV2 database file. OV2 is a binary POI database defined by TomTom.

Quick Startup

Extract records from the database

From a callback

const jov2 = require('jov2');

jov2.getRecord('path/to/db/file', (err, data) => {
  console.log(data);
});

From a promise

const jov2 = require('jov2');

jov2.getRecord('path/to/db/file')
  .then((data) => {
    console.log(data);
  })
  .catch((e) => {
    console.log(e);
  });

This method returns an array of records. Each record is a Javascript object. The record with type 2, a simple POI record, looks like:

{
  record: 2377,
  type: 2,
  length: 56,
  λ: 7.75099,
  φ: 48.58101,
  info: '[Chtx nv] 67 Strasbourg - Palais des Rohan'
},

API

jov2 provides only one method:

  • getRecord() extracts all the records from the database. It returns a promise.

getRecord (db, callback)

getRecord requires two arguments:

  • the database name,
  • a callback function.

The callback gets two arguments: err, data.

err is null or an error string.

data is an array that contains a set of objects. Each object defines a POI (see above).

Enjoy!

License

MIT.

1.0.1

3 months ago

1.0.0

4 years ago

0.4.2

5 years ago

0.4.1

6 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago