Comments (5)
The problem occurs in filter_day_period
, as it works properly for the whole saopaulo data. There are two bugs:
- In
filter_day_period()
, line 31, it is
gtfs$stops <- gtfs$stops[ stop_id %in% stop_id ]
and should be
gtfs$stops <- gtfs$stops[ stop_id %in% unique_stops ]
isn´t it?
- Filtering
stop_times
by time can create trips that have only onestop_time
, which is inconsistent as a trip must have at least twostop_times
. The implemented algorithm forgtfs2gps
supposes eachtrip
has at least twostop_times
. Should such trips be removed byfilter_day_period
? Do you know an easy way to do that usingdata.table
?
from gtfs2gps.
You're right. I've just fixed issue (1).
regarding issue (2), we should be able to discard trips with a single valid departure_time
just as we already deal with 'invalid' trips with no valid departure_time
.
from gtfs2gps.
note. the problem is in shape_id
"52896", which has only one trip_id
"8700-21-0"
from gtfs2gps.
I think I've fixed issue (2) with commit 34662d9.
The the number of stops (nstop
) is smaller than 2, the gtfs2gps function should ignore that shape_id. There are probably better ways to go around this problem and report the shape_ids that are being ignored, but this should do the work for now.
# Get the stops sequence with lat long linked to that route
# each shape_id only has one stop sequence
nstop <- gtfs_data$stop_times[trip_id %in% all_tripids, .N, by ="trip_id"]$N
# If there is less than two valid stops/departure times, jump this shape_id
if ( nstop < 2) { return(NULL) }
from gtfs2gps.
Now fully fixed with
# If there is less than two valid stops, jump this shape_id
if( min(nstop) < 2){ return(NULL) } # nocov
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.