Comments (4)
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.
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.
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 onupdate_freq(all_tripids)
else
- 4.2) update newstoptimes based onupdate_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.
This issue was already solved by #36, #48, and 4f37503.
from gtfs2gps.
Related Issues (20)
- should gtfs2gps includes as gtfs class, such as gtfstools? HOT 9
- gtfs2gps::gtfs2gps not processing transport network sf object HOT 4
- example of adjust_speed function not working HOT 1
- writing a merged gtfs list got: 'gtfs' must inherit from the 'gtfs' class HOT 2
- gtfs2gps::gtfs2gps function not exporting file with proper units
- incompatibility with gtfstools HOT 1
- Vignette link does not work HOT 1
- Check performance of using gtfstools::string_to_seconds() HOT 2
- adjust_speed approach HOT 2
- Add `progress` parameter to gtfs2gps HOT 1
- New silent parameter to gtfs2gps()
- gtfs2gps function changing input parameter by reference HOT 1
- 'speed' values are NA , but not really HOT 3
- problems with spatial_resolution input argument
- Submit v2.1-0 to CRAN
- Add new parameter ncores
- passar apend_height p/ gtfs2emis
- fix documentation of parameter `ncores`
- Issues with the upcoming release of units 0.8-2 HOT 1
- Reactivate codecov
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtfs2gps.