Comments (6)
I've added a new function merge_gtfs_feeds
to our package (commit 55eda53 ) . This is just a starting point, I believe we can improve the function from here. As it stands, the function does not check for duplicated IDs.
from gtfs2gps.
Nice! I only don´t know whether we should consider the question of GTFS files with and without frequencies. Could GTFS files of these two types be merged?
from gtfs2gps.
Merging two GTFS feeds of different types (detailed and frequency based) is not a problem per se. However, our core function gtfs2gps
currently does not work well with mixed-type GTFS feeds. As it stands, the function assumes all data in a feed are of a single type. We know from the data of Rio de Janeiro, however, that a single GTFS feed might have some trips/routes organized in one way or another. I have created a separate issue for this. This should be fun to tackle.
from gtfs2gps.
- Add
ERROR
if there are anyroute_id
orstop_ids
shared between different GTFS feeds - test output 1 (merging 2 GTFS feeds) and output 2 (getting the gtfs2gps outputs of two files)
from gtfs2gps.
quick approach to check overlapping values
spo <- system.file("extdata/saopaulo.zip", package = "gtfs2gps")
poa <- system.file("extdata/poa.zip", package = "gtfs2gps")
gtfs_list <- list(spo, poa)
# read all feeds
all_feeds <- lapply(gtfs_list, read_gtfs)
##### STOPS ----------------------
# extract stops from all GTFS feeds
stops <- sapply(all_feeds, "[", 'stops')
# extract stop ids
stop_ids <- sapply(stops, "[[", 'stop_id')
# check inersection between ids
output_intersect <- Reduce(intersect, stop_ids)
# if there is any overlap
if( length(output_intersect) = 0){
stops <- rbindlist(stops, fill = T)
}
##### AGENCY ----------------------
# extract stops from all GTFS feeds
agency <- sapply(all_feeds, "[", 'agency')
# extract stop ids
agency_ids <- sapply(agency, "[[", 'agency_id')
from gtfs2gps.
then we need to update the trips, routes, shapes and stop ids
:
for(i in 1:length(agency_ids)){
stop_ids[i] <- sprintf("%s_%s", agency_ids[[i]], stop_ids[[i]])
# route_ids[i] <- sprintf("%s_%s", agency_ids[[i]], route_ids[[i]])
# trip_ids[i] <- sprintf("%s_%s", agency_ids[[i]], trip_ids[[i]])
# ...
}
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.