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

Default to agency ID of 1 for agencies without ID. #268

Conversation

flibbertigibbet
Copy link
Contributor

Fixes #217.

@@ -13,7 +13,7 @@ object AgencyFile extends GtfsFile[Agency] {
for (s <- CsvParser.fromPath(path)) {
agencies +=
Agency(
id = s("agency_id").get.intern,
id = s("agency_id").getOrElse[String]("1"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the interned string here is an important memory optimization and should be kept around. @echeipesh, would you agree?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this particular case you're not going to have too many agencies. But overall you're correct, Interning strings saves a ton of memory even just for the parsing process.

Also, you probably need to apply the same logic for agency_id field when reading the routes.txt

@kshepard kshepard mentioned this pull request Oct 9, 2014
@kshepard kshepard merged commit 7345997 into WorldBank-Transport:develop Oct 9, 2014
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.

3 participants