Giter Club home page Giter Club logo

osrm-matching-inspection's Introduction

Matching inspection

These scripts can be used to inspect matchings generated by the map matching plugin for OSRM.

Installation

There are two ways to install the server side component. One involves building osrm-backend and node-osrm from source and one needs binary packges of a special node-osrm version.

From binary package

npm install osrm

Which downloads a binary package if it is available on your platform.

From source

Compile OSRM with debug support:

git clone https://github.com/Project-OSRM/osrm-backend.git
cd osrm-backend
mkdir -p build
cd build
cmake -DENABLE_JSON_LOGGING=1 .. 
make && sudo make install

Run:

npm install osrm --build-from-source

To download and compile node-osrm from source.

Client side components

Run:

bower install && make

To install the front-end components.

Importing traces

To import traces in GPX or CSV format contained in a folder data to the labeling database run:

node bin/server.js data

This will create a file data/clasification_db.sqlite which will contain a list of all traces and their classification.

Starting the frontend

Assuming your GPX traces are contained in a folder data in the current repository root:

Locally run:

node bin/server.js data path/to/dataset.osrm

Alternatively if you want to use osrm-routed instead of node-osrm just run:

node bin/server.js data

Which expects a osrm-routed server listening on http://127.0.0.1:5000.

Now you can view the frontend on http://127.0.0.1:8337 in your browser. It will look somewhat like this:

Which shows an interactive trellis diagram of the matching. Select a state pair to view the transition probabilities and Viterbi values.

You can use the left and right arrow key to cycle through the traces.

Classification

Opening http://127.0.0.1:8337/classify.html will display a minimal interface for easy classification. Pressing 0 will classify as unknown, 1 as valid and 2 as invalid.

The labels will be saved in classification_db.sqlite which can be used by bin/test_classification.js to verify the classifier implemented inside the OSRM plugin. bin/test_classification.js will also generate tested_db.json which is needed by bin/calibrate_classification.py to derive better classification values.

Batch matching

You can batch match a dataset using bin/traces2geojson.js data > matched.geojson which produces a geojson file containg the following features:

For every sub-matchings:

{
        "type": "Feature",
        "geometry": {
            "type": "LineString",
            "coordinates": [[lon, lat], ...],
        },
        "properties": {
            "type": "matching"
            file: "path/to/file"
            confidence: 0.5 # in [0, 1] -> 1 means very confident, 0 means no confidence
        }
}

For every trace fragment:

{
        "type": "Feature",
        "geometry": {
            "type": "LineString",
            "coordinates": [[lon, lat], ...],
        },
        "properties": {
            "type": "trace"
            file: "path/to/file"
            confidence: 0.5 # confidence of the corresponding sub-trace
        }
}

osrm-matching-inspection's People

Contributors

aaronlidman avatar dennisosrm avatar themarex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osrm-matching-inspection's Issues

Install problem with node-osrm

I tried to install the server components with npm install and I get:

npm WARN package.json @0.0.1 No repository field.
npm WARN package.json Dependency 'browserify' exists in both dependencies and devDependencies, using 'browserify@^9.0.3' from dependencies
npm ERR! Failed resolving git HEAD (git://github.com/Project-OSRM/node-osrm.git) fatal: bad object dc53afcbd1e0b58700c4aeab62e149b6250127e4
npm ERR! Failed resolving git HEAD (git://github.com/Project-OSRM/node-osrm.git) 
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.1.18
npm ERR! code 128

npm ERR! Command failed: fatal: bad object dc53afcbd1e0b58700c4aeab62e149b6250127e4
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ustroetz/projects/osrm-matching-inspection/npm-debug.log

Is this version stable and should work or is it still in development?

Missing breakage/states properties - matching, traces and diagram not displayed on map -

Hi,

I'm trying to use the matching inspection tool. The GPX data is matched, but the diagram, traces and matchings aren't displayed on the map - I always get an "Uncaught TypeError: Cannot read property 'states' of undefined"/"Uncaught TypeError: Cannot read property 'breakage' of undefined" error at matching.js line 22 / osrm.matching.js line 2502.

matching.js/osrm.matching.js 

function onMatched(response) {
  var states = response.debug.states,
      breakage = response.debug.breakage,
      matchings = response.matchings,
      trace = response.trace;
...

This is the response:

Object 
    matchings: Array[1]
        0: Object
            confidence: 0.951211
            geometry: "ot|}c@bkzx{DxbAdc@ztAdk@hWzJdt@h]rt@`Y~^jQxl@nUzyBt_AhkBxv@rjBjw@LVqN`V}fBmv@glBox@jKaVlCyG{cBqs@kToLwmAcf@khB_w@wmBmx@mgAgd@yEsBoeAqd@udAed@gxAam@agAcf@{cAcd@c~@w_@e|@m`@sqB}z@gAi@"
            indices: Array[4]
            matched_points: Array[4]
            __proto__: Object
        length: 1
        __proto__: Array[0]
    trace: Object
        classify: true
        coordinates: Array[4]
        __proto__: Object
    __proto__: Object
        __defineGetter__: function __defineGetter__() { [native code] }
        __defineSetter__: function __defineSetter__() { [native code] }
        __lookupGetter__: function __lookupGetter__() { [native code] }
        __lookupSetter__: function __lookupSetter__() { [native code] }
        constructor: function Object() { [native code] }
        hasOwnProperty: function hasOwnProperty() { [native code] }
        isPrototypeOf: function isPrototypeOf() { [native code] }
        propertyIsEnumerable: function propertyIsEnumerable() { [native code] }
        toLocaleString: function toLocaleString() { [native code] }
        toString: function toString() { [native code] }
        valueOf: function valueOf() { [native code] }
        get __proto__: function __proto__() { [native code] }
        set __proto__: function __proto__() { [native code] }

greetings, Sabine

Can't find node_sqlite3.node

I am trying to import traces. The gpx files are in the folder data.
If I use node bin/server.js data

I get the following error:

module.js:338
    throw err;
          ^
Error: Cannot find module '/Users/ustroetz/projects/osrm-matching-inspection/node_modules/sqlite3/lib/binding/node-v14-darwin-x64/node_sqlite3.node'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/ustroetz/projects/osrm-matching-inspection/node_modules/sqlite3/lib/sqlite3.js:4:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

The module node_sqlite3.node exists under the specified path. What could be the reason for the error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.