ipeaGIT / gtfs2emis

R package to estimate public transport emissions based on GTFS data
https://ipeagit.github.io/gtfs2emis/
Other
28 stars 2 forks source link

cmd check messages about trips with "less than two stop_ids" #81

Closed rafapereirabr closed 2 years ago

rafapereirabr commented 2 years ago

cmd check is printing messages about several trip what have "less than two stop_ids", and several shapes with no departure_time. I don't know why we get these messages. I've check the GTFS feed and looks fine. Example below.

library(gtfs2emis)
library(gtfstools)
library(data.table)
library(ggplot2)
library(gtfs2gps)

# path to GTFS.zip file
gtfs_file <- system.file("extdata/irl_dub/irl_dub_gtfs.zip", package = "gtfs2emis")

# read GTFS
gtfs <- gtfstools::read_gtfs(gtfs_file)

# Keep Monday services GTFS
gtfs <- gtfstools::filter_by_weekday(gtfs, 
                                     weekday = c('saturday', 'sunday'), 
                                     keep = FALSE)

# check number of stops in trip_id
id <- "6030.2.60-15B-b12-1.359.O"
gtfs1 <- gtfstools::filter_by_trip_id(gtfs, trip_id =  id )
head(gtfs1$stops)
>         stop_id                     stop_name stop_lat  stop_lon
> 1: 8220DB000400         Shaw Street, stop 400 53.34485 -6.253390
> 2: 8220DB000493       Holles Street, stop 493 53.33985 -6.247377
> 3: 8220DB000494        Clare Street, stop 494 53.34144 -6.251682
> 4: 8220DB000495      Pearse Station, stop 495 53.34359 -6.249747
> 5: 8220DB001016  South Richmond St, stop 1016 53.33116 -6.264415
> 6: 8220DB001017 Rathmines Rd Lower, stop 1017 53.32937 -6.264322
# check number of stops in shape_id
gtfs2 <- gtfstools::filter_by_shape_id(gtfs, shape_id =  '60-15A-b12-1.358.I' )
head(gtfs2$stop_times)

>                      trip_id arrival_time departure_time      stop_id
> 1: 5972.2.60-15A-b12-1.358.I     09:05:25       09:05:25 8220DB001072
> 2: 5972.2.60-15A-b12-1.358.I     09:07:04       09:07:04 8220DB007577
> 3: 5972.2.60-15A-b12-1.358.I     09:08:29       09:08:29 8220DB001353
> 4: 5972.2.60-15A-b12-1.358.I     09:10:21       09:10:21 8220DB001354
> 5: 5972.2.60-15A-b12-1.358.I     09:12:33       09:12:33 8220DB007578
> 6: 5972.2.60-15A-b12-1.358.I     09:15:05       09:15:05 8220DB007582
>    stop_sequence  stop_headsign pickup_type drop_off_type shape_dist_traveled
> 1:            27 Merrion Square           0             0             7013.99
> 2:            28 Merrion Square           0             0             7329.64
> 3:            29 Merrion Square           0             0             7574.00
> 4:            30 Merrion Square           0             0             7914.55
> 5:            32 Merrion Square           0             0             8312.00
> 6:            33 Merrion Square           0             0             8650.28
rafapereirabr commented 2 years ago

issue fixed upstream in the gtfs2gps package