Giter Club home page Giter Club logo

time-travel's Introduction

To run project you will need install map-matching from https://github.com/chucre/map-matching.

$ git clone https://github.com/chucre/map-matching

Then you will need download a OpenStreet Map database (I use brazil database):

$ cd map-matching
$ wget download.geofabrik.de/south-america/brazil-latest.osm.pbf

Once you have the databse downloaded, you will need import it into graphhopper internal database

$ ./map-matching.sh action=import datasource=./brazil-latest.osm.pbf vehicle=car

Now you will start the map-matching server:

./map-matching.sh action=start-server

Now you will need open a new terminal and unzip sample file and run project:

$ npm install
$ gunzip sample/points.txt.gz
$ node processFile.js


These project is based on Chucre time travel algorithm that fallows:

case 1:


          Link 1                   Link 2                Link 3
+---------------------------+------------------------+-------------------------+
|                           |                        |                         |
 +-----+---+----+----+----+  +-----+---------+------+ +-----------------------+
         |               |                              |                  |
   point 0               |                              point x            |
                    point n(last)                                 point z (last)


case 2:
        Link 1                   Link2
+-------------------------+--------------------------+
|                         |                          |
 +-----------------------+ +------------------------+
   |                  |
   point 0         point n

pseudo code:

  delta_inicial
  delta_final
  t_inicial
  t_final
  percurso_percorrido
  tempo_percorrido_conhecido = t_final-t_inicial
  tempo_total = tempo_percorrido_conhecido+proporção_percorrida_até a proxima coleta

  achou_ponto_inicial <- false
  achou_ponto_final <- false

  link <- cada line|multiline do link
    if !achou_ponto_inicial
      if ponto_inicial lies link
        delta_inicial += distance_to(link[0], ponto_inicial)
        persurso_percorrido += distance_to(link[1], ponto_inicial)
        achou_ponto_inicial=true
      else
        delta_inicial += distance_to(link[0], link[1])
      end
    else if !achou_pont_final
      if ponto_final lies link
        persurso_percorrido += distance_to(link[0], ponto_final)
        delta_final += distance_to(link[1], ponto_final)
      else
        persurso_percorrido += distance_to(link[0], link[1])
      end
    else
      delta_final += distance_to(link[0], link[1])
    end

time-travel's People

Contributors

chucre avatar mirlabraga avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.