Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new RawGTFS::SourceFormat field and strip file paths. #147

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

antoine-de
Copy link
Collaborator

The new SourceFormat store the fact that the GTFS has been read from a directory or a zip.

Also strip the base path in the files field of the RawGTFS. This way, if the data were were from a directory with:
RawGTFS::new("some/path/to/read"), the files will contains stops.txt and not some/path/to/read/stops.txt. It's more consistent to the way it will be if the data is read from a zip (and makes it possible to know if the data were in a subfolder).

The new SourceFormat store the fact that the GTFS has been read from a
directory or a zip.

Also strip the base path in the `files` field of the `RawGTFS`. This
way, if the data were were from a directory with:
`RawGTFS::new("some/path/to/read")`, the `files` will contains
`stops.txt` and not `some/path/to/read/stops.txt`. It's more consistent
to the way it will be if the data is read from a zip (and makes it
possible to know if the data were in a subfolder).
@antoine-de
Copy link
Collaborator Author

Note: I did not bump the version, I plan to add another PR bumping a dependency and removing some warnings

@antoine-de
Copy link
Collaborator Author

Note: I added a test to make it explicit that subdirectory does not work when reading from a path (like I though it would 😁 )

@antoine-de antoine-de merged commit 93ee166 into rust-transit:main Nov 8, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants