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

ATOC Stop IDs missing #29

Closed jeanbaptistemarie closed 3 years ago

jeanbaptistemarie commented 3 years ago

I used UK2GTFS to build a GTFS archive from ATOC ttis725.zip

The OTP graphs build fails because of stop ids missing. I stopped after adding manually eight missing IDs in the file stops.txt when trying to make the building work.

Errors reported by graph building:

Caused by: org.onebusaway.gtfs.serialization.EntityReferenceNotFoundException: entity reference not found: type=org.onebusaway.gtfs.model.Stop id= WMBYEFR

Caused by: org.onebusaway.gtfs.serialization.EntityReferenceNotFoundException: entity reference not found: type=org.onebusaway.gtfs.model.Stop id= ASHFKI

Caused by: org.onebusaway.gtfs.serialization.EntityReferenceNotFoundException: entity reference not found: type=org.onebusaway.gtfs.model.Stop id= MNCRAMM

Caused by: org.onebusaway.gtfs.serialization.EntityReferenceNotFoundException: entity reference not found: type=org.onebusaway.gtfs.model.Stop id= MNCRAML

Caused by: org.onebusaway.gtfs.serialization.EntityReferenceNotFoundException: entity reference not found: type=org.onebusaway.gtfs.model.Stop id= MNCRANC

Caused by: org.onebusaway.gtfs.serialization.EntityReferenceNotFoundException: entity reference not found: type=org.onebusaway.gtfs.model.Stop id= MNCRASM

Caused by: org.onebusaway.gtfs.serialization.EntityReferenceNotFoundException: entity reference not found: type=org.onebusaway.gtfs.model.Stop id= MNCRALM

Caused by: org.onebusaway.gtfs.serialization.EntityReferenceNotFoundException: entity reference not found: type=org.onebusaway.gtfs.model.Stop id= MNCRAWM

mem48 commented 3 years ago

This could be some new tiplocs have you tried locations = "file" in atoc2gtfs ?

jeanbaptistemarie commented 3 years ago

I created the gtfs again using locations = "file" in atoc2gtfs

This time the stop id that is missing is "UPMNLT"

Exception in thread "main" org.onebusaway.csv_entities.exceptions.CsvEntityIOException: io error: 
entityType=org.onebusaway.gtfs.model.StopTime path=stop_times.txt lineNumber=5672
Caused by: org.onebusaway.gtfs.serialization.EntityReferenceNotFoundException: 
entity reference not found: type=org.onebusaway.gtfs.model.Stop id=UPMNL

Is there option I can use to get it up and running? Many thanks

mem48 commented 3 years ago

The quickest solution is to make your own locations object.

You can load the tiplocs table that comes with the package and add any missing stops. The CIF file comes with its own locations data which is what you use when locations = "file" but the data is often low quality (stops in the wrong place), or missing. This is why the default is locations = tiplocs. I periodically update the tiplocs table but clearly, it is now out of date.

mem48 commented 3 years ago

You can also use gtfs_validate_internal rather than having to build an OTP graph to find problems with the GTFS file.

https://itsleeds.github.io/UK2GTFS/reference/gtfs_validate_internal.html

The function is not documented well, but should give clear warnings for some basic errors

mem48 commented 3 years ago

Yep, there are 41 new tiplocs

image

As some are in Norway, the will need manually fixing before adding to the package.

mem48 commented 3 years ago

I've pushed some new tiplocs, you will need to reinstall the package.

The Norway ones are a mystery, they don't represent a real location

jeanbaptistemarie commented 3 years ago

Thank you for updating the tiploc table. I will rebuild the graph and let you know here how things worked out