GithubHelp home page GithubHelp logo

Comments (4)

pedro-andrade-inpe avatar pedro-andrade-inpe commented on July 28, 2024 1

I thing round() is a good idea. My only concern is that, as we are going to compute the average speed, having zero values for time is always unwanted, as it will produce infinite speeds. Additionally, if considering a distance of 15 meters, the maximum speed will be 54km/h if the travel time takes one second, but there are speeds higher than this value in some gtfs data that we use. Possibly it will be better to compute the speeds using the original values before converting to ITime.

from gtfs2gps.

rafapereirabr avatar rafapereirabr commented on July 28, 2024

Indeed, this happens because iTime only accepts integer values so the smaller unit is seconds. This idea of using round() seems like a good suggestion to me. @pedro-andrade-inpe , what do you think ?

> data.table::as.ITime(1) + data.table::as.ITime(1)
[1] "00:00:02"
> 
> 
> data.table::as.ITime(0) + data.table::as.ITime(1)
[1] "00:00:01"
> 
> 
> data.table::as.ITime(.5) + data.table::as.ITime(.5)
[1] "00:00:00"

from gtfs2gps.

rafapereirabr avatar rafapereirabr commented on July 28, 2024

Arredondar dentro do parenteses na linha 189 desse script
https://github.com/ipeaGIT/gtfs2gps/blob/9fb6909aeedd1001bef6731e5cf00280db07309f/R/gtfs2gps_dt_parallel.R

from gtfs2gps.

pedro-andrade-inpe avatar pedro-andrade-inpe commented on July 28, 2024

Every convertion to ITimes in mod_updates that involves an arithmetical operation already uses round. Therefore this issue can be considered finished.

from gtfs2gps.

Related Issues (20)

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.