Skip to content

gtfstools blanking stop_id called 'NA' #87

@Ge-Rag

Description

@Ge-Rag

I found a very odd error where unquoted stop_ids with the name 'NA' are deleted from stop_times and stops.
Just running this code on the feed will cause the entries in stop_times to be blanked:

I am using the newest version of gtfstools. (1.4.0)

gtfs_data <- read_gtfs('tmp/raw-gtfs-00.zip')
write_gtfs(gtfs_data, path = 'tmp/output.zip')

stop_times before: (lines 3376-3381)

trip_id arritval_time departure_time stop_id stop_sequence
6c4bdab144746c0fbb55c60d40|6a2dc7e303,05:48:30,05:49:00,VP,20
6c4bdab144746c0fbb55c60d40|6a2dc7e303, 05:50:30,05:51:00,EN,21
6c4bdab144746c0fbb55c60d40|6a2dc7e303,05:53:00,05:53:00,NA,22
6c4bdab144746c0fbb55c60d40|6a2dc7e300,04:13:00,04:13:00,NA,1
6c4bdab144746c0fbb55c60d40|6a2dc7e300,04:14:30,04:15:00,EN,2

stop_times after:

6c4bdab144746c0fbb55c60d40|6a2dc7e303,05:48:30,05:49:00,VP,20,1
6c4bdab144746c0fbb55c60d40|6a2dc7e303,05:50:30,05:51:00,EN,21,1
6c4bdab144746c0fbb55c60d40|6a2dc7e303,05:53:00,05:53:00,,22,1
6c4bdab144746c0fbb55c60d40|6a2dc7e300,04:13:00,04:13:00,,1,1
6c4bdab144746c0fbb55c60d40|6a2dc7e300,04:14:30,04:15:00,EN,2,1
6c4bdab144746c0fbb55c60d40|6a2dc7e300,04:16:30,04:17:00,VP,3,1

The gtfs feed comes from here, but cannot be downloaded without registering, so I am attaching it.
https://nap.transportes.gob.es/Files/Detail/1373

Here is the file I downloaded from that site.
raw-gtfs-00.zip

I hope you can help resolve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions