GithubHelp home page GithubHelp logo

Comments (4)

rafapereirabr avatar rafapereirabr commented on July 28, 2024

Hi Joao. I've created the function test_gtfs_freq.R to test whether a GTFS feed is frequency based or whether it's a simple feed with a detailed stop_times.txt file. This should help solving this issue

from gtfs2gps.

Joaobazzo avatar Joaobazzo commented on July 28, 2024

After merging the functions:

  • see if it's possible to keep the same units throughout the code, we keep converting "km" <-> "m" sometimes

from gtfs2gps.

Joaobazzo avatar Joaobazzo commented on July 28, 2024

There are basically two scripts,gtfs2gps_single_dt.R and mod_updates.R, which will be pulled today @pedro-andrade-inpe . Here's the approach

gtfs2gps_single_dt.R

gtfs2gps_dt_single <- function(gtfszip, filepath, spatial_resolution = 15, week_days = TRUE){
- 1) read GTFS
- 2) convert into sf object
# Core function

corefun <- function(shapeid){
- 3) spatial interpolation
# test data type

if(test_gtfs_freq(gtfs_data)=="frequency"){
- 4.1) update newstoptimes based on update_freq(all_tripids)
else
- 4.2) update newstoptimes based on update_dt(all_tripids)
}

5) write object
}

6) future.apply for all shapeids

return(output)
}

mod_updates.R

update_freq <- function(tripid,new_stoptimes){
1) build 'id' vector all speed between stop sequences
2) speed estimation
3) update departure times
4) get freq info for that trip

# start frequencies functions
update_newstoptimes_freq(starttimes,freq_temp){

update_departure_stoptimes(i,dt_list){
5.1) update departure stoptimes
return(dt_list)

5.2) function to update stoptimes of each departure (update_departure_stoptimes)
5.3) apply function and return the stop times of all departures from that period (update_departure_stoptimes)
return(departure_stoptimes)

6) update newstoptimes frequency
return(new_stoptimes)

the simple data frame behaves similarly

update_dt <- function(tripid,new_stoptimes){
1) build 'id' vector all speed between stop sequences
2) speed estimation
3) update departure times
4) recalculate time stamps
return(new_stoptimes)

from gtfs2gps.

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

This issue was already solved by #36, #48, and 4f37503.

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.