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

How should GTFS transform strategies interact with extensions? #113

Closed
kurtraschke opened this issue Apr 10, 2019 · 1 comment · Fixed by #115
Closed

How should GTFS transform strategies interact with extensions? #113

kurtraschke opened this issue Apr 10, 2019 · 1 comment · Fixed by #115

Comments

@kurtraschke
Copy link
Contributor

kurtraschke commented Apr 10, 2019

Summary:

onebusaway-gtfs provides an extension mechanism (via onebusaway-csv-entities) which can be used when reading and writing GTFS feeds (in order to read or write fields which are not declared in the model class). However, there is no mechanism for transform strategies in onebusaway-gtfs-transformer to register their intention to use a particular extension, so when GtfsTransformer reads or writes GTFS, transforms are unable to register their extensions with the EntitySchemaFactory, and thus extensions are neither read nor written.

Note that there are some code fragments (specifically, the SchemaUpdateStrategy class, and GtfsTransformer.writeGtfs()) that suggest a prior effort to address this?

Somewhat (tangentially) related to #102, particularly as it pertains to modularizing/extracting agency-specific transforms (if they depend on extension fields).

Steps to reproduce:

  1. Implement GtfsTransformStrategy.
  2. Call .putExtension() or .getExtension() on an instance of a GTFS model class.

Expected behavior:

GTFS transform strategies should be able to declare the extensions they will use when reading or writing feeds.

Observed behavior:

GTFS transform strategies are not able to declare the extensions they will use, so they are not able to use the extension mechanism to read or write columns other than those declared in the model classes.

@kurtraschke
Copy link
Contributor Author

Sample implementation in a38a2aa - @sdjacobs if this is of interest I can open a PR...

sheldonabrown added a commit that referenced this issue Jul 14, 2020
Fix #113 - enable implementations of GtfsTransformStrategy to use GTFS extensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant