ITSLeeds / UK2GTFS

Convert UK transport data (TransXchange / ATOC CIF) to GTFS format in R
https://itsleeds.github.io/UK2GTFS/
GNU General Public License v3.0
37 stars 13 forks source link

Error in gtfs_merge(gtfs_all, force = force_merge) : Duplicated Agency IDs 2 #62

Closed bghjmn32 closed 10 months ago

bghjmn32 commented 10 months ago

Hi,

I am a beginner student in GIS area (also R). I am trying to use this library to transform TNDS data. Thanks for your work firstly!

Your demo code works for me.

library(UK2GTFS)
path_in <- "TNDSV2.5/EA.zip"
gtfs <- transxchange2gtfs(path_in = path_in,
          ncores = 8)

gtfs_write(gtfs, 
           folder = "/home/UK2GTFS/output",
           name = "gtfs_EA")

However when I try to apply this code to different files from TNDS dataset such as EM.zip, L.zip...etc. It always show me this error:

2023-11-02 14:28:00.921419 Converting to GTFS, multicore

|=============================================================================================================================================================================================================================================| 100% All files converted Error in gtfs_merge(gtfs_all, force = force_merge) : Duplicated Agency IDs 2 Merging failed, returing unmerged GFTS object for analysis

Maybe this is very basic but I actually don't understand this error and how to fix it.

Could you please help me a bit? @mem48

Thanks!

bghjmn32 commented 10 months ago

And I also continuously meet this error

Scottish holidays are downloaded but not properly supported Warning: '/tmp/Rtmp0jrFBR/txc' already existsWarning: error 1 in extracting from zip file2023-11-02 17:31:03.968439 Importing TransXchange files, multicore |=============================================================================================================================================================================================================================================| 100%Error processing TransXChange file: /tmp/Rtmp0jrFBR/cambs_A2BR_1A2001A.xml. Error: task 1 failed - "could not find function "transxchange_import_try""

Error in { : task 1 failed - "could not find function "transxchange_import_try"" 4.stop(simpleError(msg, call = expr)) 3.e$fun(obj, substitute(ex), parent.frame(), e$data) 2.foreach::%dopar%(boot, {transxchange_import_try(files[i], try_mode = try_mode)}) 1.transxchange2gtfs(path_in = path_in, ncores = 12, force = TRUE, try_mode = TRUE)

I can't find the function transxchange_import_try in your function list....

This also happend to another function transxchange_export_try

UPDATE:

I've found that I can only seem to convert one file at a time, after which I need to reinstall the package UK2GTFS and then convert another one, otherwise I get the error above. Sometimes reinstalling doesn't work either, does anyone know how to fix this strange phenomenon please? My R and Rstudio environments are brand new.

mem48 commented 10 months ago

The TXC 2.5 is not supported use the older version

bghjmn32 commented 10 months ago

@mem48 Hi thanks for your reply. I am still trying to solve this issue.

What do you mean older version? I think I am using the latest version of your github repo.

Do you mean my dataset can only be transformed by old version UK2GTFS? So how old it needed to be?

mem48 commented 10 months ago

The TNDS is released with two versions v2.1 and v2.5 you need to download the v2.1 as v2.5 is not supported by UK2GTFS

bghjmn32 commented 10 months ago

@mem48 Thanks I understand.

But in their official website FTP server, they only provide TNDS2.5 version and I can't find any inforamtion about 2.1 with Google. Could you please kindly give me some tips?

image